diff --git a/apps/cases/tests/test_units/test_investigation_cases.py b/apps/cases/tests/test_units/test_investigation_cases.py index ce227eb5a15e327c626a69ec63a82e411b1118eb..d07e8e44bf91414f1be40df6b0d660beb24b75e6 100644 --- a/apps/cases/tests/test_units/test_investigation_cases.py +++ b/apps/cases/tests/test_units/test_investigation_cases.py @@ -46,7 +46,7 @@ class InvestigationCaseViewTest(APITestCase): reference_case_id=self.reference_case.case_id, deleted_at=datetime.now(tz=pytz.timezone(TIMEZONE)), ) - self.other_inactive_case = InvestigationCaseFactory( + self.inactive_case = InvestigationCaseFactory( author=self.author, case_subject_id=self.case_subject.subject_id, reference_case_id=self.reference_case.case_id, @@ -60,7 +60,7 @@ class InvestigationCaseViewTest(APITestCase): inactive_case_str = ( f"[Inactive] Rev. {self.inactive_case.revision_id} | by {self.inactive_case.author}" ) - self.assertEqual(inactive_case_str, str(self.other_inactive_case)) + self.assertEqual(inactive_case_str, str(self.inactive_case)) active_case_str = ( f"[Active] Rev. {self.case.revision_id} | by {self.case.author}" @@ -234,15 +234,15 @@ class InvestigationCaseViewTest(APITestCase): self.assertIn('"action_type":"{}"'.format(ACTIVITY_TYPE_EDIT), response_string) def test_edit_inactive_investigation_case_fails(self): - url = self.BASE_URL + str(self.other_inactive_case.revision_id) + "/" + url = self.BASE_URL + str(self.inactive_case.revision_id) + "/" data = { - "case_subject_id": str(self.other_inactive_case.case_subject_id), + "case_subject_id": str(self.inactive_case.case_subject_id), "reference_case_id": str(self.reference_case.case_id), - "case_relation": self.other_inactive_case.case_relation, - "medical_symptoms": self.other_inactive_case.medical_symptoms, - "risk_factors": self.other_inactive_case.risk_factors, - "is_referral_needed": not self.other_inactive_case.is_referral_needed, - "medical_facility_reference": self.other_inactive_case.medical_facility_reference, + "case_relation": self.inactive_case.case_relation, + "medical_symptoms": self.inactive_case.medical_symptoms, + "risk_factors": self.inactive_case.risk_factors, + "is_referral_needed": not self.inactive_case.is_referral_needed, + "medical_facility_reference": self.inactive_case.medical_facility_reference, } response = self.client.put(path=url, data=data, format="json",) @@ -310,7 +310,7 @@ class InvestigationCaseViewTest(APITestCase): ) def test_delete_inactive_investigation_case_fails(self): - url = self.BASE_URL + str(self.other_inactive_case.revision_id) + "/" + url = self.BASE_URL + str(self.inactive_case.revision_id) + "/" response = self.client.delete(url) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)