From bef5f45bec69c2b0cc3c8820eaabbc426aae4719 Mon Sep 17 00:00:00 2001 From: RuthShryock Date: Wed, 13 Dec 2023 10:33:14 -0500 Subject: [PATCH] updating tests --- .../main/tests/test_service_health_minimal.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/onadata/apps/main/tests/test_service_health_minimal.py b/onadata/apps/main/tests/test_service_health_minimal.py index bb81bc28b..f4d49eed4 100644 --- a/onadata/apps/main/tests/test_service_health_minimal.py +++ b/onadata/apps/main/tests/test_service_health_minimal.py @@ -3,17 +3,11 @@ class ServiceHealthMinimalTestCase(TestCase): - url = reverse('service-health-minimal') + url = reverse("service-health-minimal") def test_service_health_minimal(self): - res = self.client.get(self.url) - self.assertEqual(res.status_code, 200) + with self.assertNumQueries(0): + res = self.client.get(self.url) - # Check that the response content is "ok" - expected_content = 'ok' - actual_content = res.content.decode('utf-8') - self.assertEqual(actual_content, expected_content) - - # Ensure that no database queries were executed - self.assertNumQueries(0) - \ No newline at end of file + # Check that the response content contains "ok" + self.assertContains(res, "ok")