@@ -12,6 +12,14 @@ def test_readiness(self):
1212
1313 @override_settings (SIMPLE_HEALTH_CHECKS = {'simple_health_check.checks.dummy.DummyFalse' : None })
1414 def test_no_readiness (self ):
15+ response = self .client .get ('/readiness/' )
16+ self .assertContains (response , b'down' , status_code = 503 )
17+
18+ @override_settings (
19+ SIMPLE_HEALTH_CHECK_ERROR_CODE = 500 ,
20+ SIMPLE_HEALTH_CHECKS = {'simple_health_check.checks.dummy.DummyFalse' : None },
21+ )
22+ def test_other_error_code (self ):
1523 response = self .client .get ('/readiness/' )
1624 self .assertContains (response , b'down' , status_code = 500 )
1725
@@ -54,7 +62,7 @@ def test_cache_aliases(self):
5462 )
5563 def test_cache_no_rediness (self ):
5664 response = self .client .get ('/readiness/' )
57- self .assertContains (response , b'down' , status_code = 500 )
65+ self .assertContains (response , b'down' , status_code = 503 )
5866
5967 @override_settings (
6068 SIMPLE_HEALTH_CHECKS = {
@@ -81,7 +89,7 @@ def test_ps_disk_usage(self):
8189 )
8290 def test_ps_disk_usage_no_rediness (self ):
8391 response = self .client .get ('/readiness/' )
84- self .assertContains (response , b'down' , status_code = 500 )
92+ self .assertContains (response , b'down' , status_code = 503 )
8593
8694 @override_settings (
8795 SIMPLE_HEALTH_CHECKS = {
@@ -108,4 +116,4 @@ def test_ps_memory_usage(self):
108116 )
109117 def test_ps_memory_usage_no_rediness (self ):
110118 response = self .client .get ('/readiness/' )
111- self .assertContains (response , b'down' , status_code = 500 )
119+ self .assertContains (response , b'down' , status_code = 503 )
0 commit comments