Skip to content

Commit 53f36f6

Browse files
added more indepth testing
1 parent ce0c22b commit 53f36f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

backend/npdfhir/tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,36 +177,42 @@ def test_list_filter_by_name(self):
177177
response = self.client.get(url, {"name": "Cumberland"})
178178
self.assertEqual(response.status_code, status.HTTP_200_OK)
179179
self.assertIn("results", response.data)
180+
self.assertGreaterEqual(response.data["results"]["total"], 1)
180181

181182
def test_list_filter_by_organization_type(self):
182183
url = reverse("fhir-organization-list")
183184
response = self.client.get(url, {"organization_type": "Hospital"})
184185
self.assertEqual(response.status_code, status.HTTP_200_OK)
185186
self.assertIn("results", response.data)
187+
self.assertGreaterEqual(response.data["results"]["total"], 1)
186188

187189
def test_list_filter_by_npi_general(self):
188190
url = reverse("fhir-organization-list")
189191
response = self.client.get(url, {"identifier":"1427051473"})
190192
self.assertEqual(response.status_code, status.HTTP_200_OK)
191193
self.assertIn("results", response.data)
194+
self.assertGreaterEqual(response.data["results"]["total"], 1)
192195

193196
def test_list_filter_by_npi_specific(self):
194197
url = reverse("fhir-organization-list")
195198
response = self.client.get(url, {"identifier":"NPI|1427051473"})
196199
self.assertEqual(response.status_code, status.HTTP_200_OK)
197200
self.assertIn("results", response.data)
201+
self.assertGreaterEqual(response.data["results"]["total"], 1)
198202

199203
def test_list_filter_by_otherID_general(self):
200204
url = reverse("fhir-organization-list")
201205
response = self.client.get(url, {"identifier":"001586989"})
202206
self.assertEqual(response.status_code, status.HTTP_200_OK)
203207
self.assertIn("results", response.data)
208+
self.assertGreaterEqual(response.data["results"]["total"], 1)
204209

205210
def test_list_filter_by_otherID_specific(self):
206211
url = reverse("fhir-organization-list")
207212
response = self.client.get(url, {"identifier":" 1|001586989"})
208213
self.assertEqual(response.status_code, status.HTTP_200_OK)
209214
self.assertIn("results", response.data)
215+
self.assertGreaterEqual(response.data["results"]["total"], 1)
210216

211217
# this test data is not in the database yet so no point of including them but this is what the test should look like when we eventually do get them in
212218

0 commit comments

Comments
 (0)