Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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