Fakultas Ilmu Komputer UI

Commit e8d68a2f authored by Jonathan Christopher Jakub's avatar Jonathan Christopher Jakub
Browse files

[GREEN] Fix wrong variable name on test_investigation_cases

parent c88de0ca
Pipeline #39457 passed with stages
in 10 minutes and 19 seconds
......@@ -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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment