Fakultas Ilmu Komputer UI

Commit 2f7efa2a authored by Dave Nathanael's avatar Dave Nathanael
Browse files

[REFACTOR] Change test to be flexible on case CSV filename

parent 79302cc8
......@@ -186,10 +186,10 @@ class ExportableViewTest(APITestCase):
response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
'attachment; filename="cases.csv"'
content_disposition_header = response.get('Content-Disposition')
self.assertIn('attachment;', content_disposition_header)
self.assertIn('filename="cases-', content_disposition_header)
self.assertIn('.csv', content_disposition_header)
response_content = response.content.decode('utf-8')
reader = csv.reader(io.StringIO(response_content))
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