Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Sep 19, 2024
1 parent 900690d commit 1f3762c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions care/facility/tests/test_patient_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,27 @@ def setUpTestData(cls):
def get_base_url(self) -> str:
return "/api/v1/patient/"

def test_update_patient_with_meta_info(self):
self.client.force_authenticate(user=self.user)
res = self.client.patch(
f"{self.get_base_url()}{self.patient.external_id}/",
data={
"meta_info": {
"socioeconomic_status": "VERY_POOR",
"domestic_healthcare_support": "FAMILY_MEMBER",
}
},
format="json",
)
self.assertEqual(res.status_code, status.HTTP_200_OK)
self.assertDictContainsSubset(
{
"socioeconomic_status": "VERY_POOR",
"domestic_healthcare_support": "FAMILY_MEMBER",
},
res.data.get("meta_info"),
)

def test_has_consent(self):
self.client.force_authenticate(user=self.user)
response = self.client.get(self.get_base_url())
Expand Down

0 comments on commit 1f3762c

Please sign in to comment.