Skip to content

Commit

Permalink
Tests for ICD11 retrieve by ID API
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Jan 17, 2024
1 parent 5e7374b commit 36e2d69
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from rest_framework import status
from rest_framework.test import APITestCase

from care.utils.tests.test_utils import TestUtils
Expand Down Expand Up @@ -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)

0 comments on commit 36e2d69

Please sign in to comment.