Coverage for sm / test_health.py: 100%

13 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-04-17 13:46 +0000

1from django.test import TestCase 

2from django.urls import reverse 

3import json 

4 

5 

6class HealthCheckTest(TestCase): 

7 def test_health_endpoint(self): 

8 url = reverse("health") 

9 response = self.client.get(url) 

10 self.assertEqual(response.status_code, 200) 

11 

12 data = json.loads(response.content) 

13 self.assertEqual(data["status"], "healthy") 

14 self.assertIn("version", data) 

15 self.assertIn("last_modification", data) 

16 self.assertEqual(data["checks"]["database"], "ok")