How to use the dockerflow.django.checks.register function in dockerflow

To help you get started, we’ve selected a few dockerflow examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla-services / python-dockerflow / tests / django / test_django.py View on Github external
def test_redis_check(dockerflow_middleware, reset_checks, rf, settings):
    settings.DOCKERFLOW_CHECKS = ["dockerflow.django.checks.check_redis_connected"]
    checks.register()
    request = rf.get("/__heartbeat__")
    response = dockerflow_middleware.process_request(request)
    assert response.status_code == 200
github mozilla-services / python-dockerflow / tests / django / test_django.py View on Github external
def test_heartbeat(dockerflow_middleware, reset_checks, rf, settings):
    request = rf.get("/__heartbeat__")
    response = dockerflow_middleware.process_request(request)
    assert response.status_code == 200

    settings.DOCKERFLOW_CHECKS = [
        "tests.django.django_checks.warning",
        "tests.django.django_checks.error",
    ]
    checks.register()
    response = dockerflow_middleware.process_request(request)
    assert response.status_code == 500