diff --git a/care/facility/tests/test_icd11_search.py b/care/facility/tests/test_icd11_api.py similarity index 81% rename from care/facility/tests/test_icd11_search.py rename to care/facility/tests/test_icd11_api.py index 933ed1b74e..b2d6ecee56 100644 --- a/care/facility/tests/test_icd11_search.py +++ b/care/facility/tests/test_icd11_api.py @@ -1,3 +1,4 @@ +from rest_framework import status from rest_framework.test import APITestCase from care.utils.tests.test_utils import TestUtils @@ -40,3 +41,13 @@ def test_search_with_disease_code(self): res = self.search_icd11("1A00 Cholera") self.assertContains(res, "1A00 Cholera") + + def test_get_icd11_by_valid_id(self): + res = self.client.get("/api/v1/icd/133207228/") + self.assertEqual( + res.data["label"], "CA22 Chronic obstructive pulmonary disease" + ) + + def test_get_icd11_by_invalid_id(self): + res = self.client.get("/api/v1/icd/invalid/") + self.assertEqual(res.status_code, status.HTTP_404_NOT_FOUND)