Fakultas Ilmu Komputer UI

Commit b6a22a1b authored by Dave Nathanael's avatar Dave Nathanael
Browse files

[RED] Write test for include_positive query parameter on Investigation

parent 1dcd8cfe
Pipeline #46148 failed with stages
in 1 minute and 55 seconds
......@@ -111,6 +111,24 @@ class InvestigationCaseViewTest(APITestCase):
self.assertIn(str(self.reference_case.case_subject.id), response_string)
self.assertIn(str(self.reference_case.author.id), response_string)
def test_list_all_investigation_cases_success(self):
url = self.BASE_URL + "?include_positive=true"
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
response_string = response.rendered_content.decode("utf-8")
self.assertIn('"count":2', response_string)
self.assertIn('"next":null', response_string)
self.assertIn('"previous":null', response_string)
self.assertIn(str(self.case.id), response_string)
self.assertIn(str(self.case.case_subject.id), response_string)
self.assertIn(str(self.case.author.id), response_string)
self.assertIn(str(self.reference_case.id), response_string)
self.assertIn(str(self.reference_case.case_subject.id), response_string)
self.assertIn(str(self.reference_case.author.id), response_string)
def test_retrieve_investigation_case_fails_on_deleted_subject(self):
url = self.BASE_URL + str(self.other_deleted_case.id) + "/"
......
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