Fakultas Ilmu Komputer UI

Verified Commit 7fbe7018 authored by Muhammad Ariq Basyar's avatar Muhammad Ariq Basyar
Browse files

change header from "multipart/form-data" to "application/x-www-form-urlencoded" at tests

sometimes django cant receive data using request.data with multipart/form-data as the content-type header
parent d5a0958f
Pipeline #64073 failed with stages
in 6 minutes and 3 seconds
......@@ -133,5 +133,5 @@ class FasilitasRelatedViewTest(InformasiFasilitasViewTest):
'rating': 3,
'tag': 'KR'}
response = client.put(urls_put, data=send_data,
content_type="multipart/form-data")
content_type="application/x-www-form-urlencoded")
self.assertEqual(response.status_code, HTTPStatus.ACCEPTED)
......@@ -112,5 +112,5 @@ class LokasiRelatedViewTest(InformasiFasilitasViewTest):
urls = reverse('update-lokasi',
kwargs={'nama_lokasi': self.lokasi_test_1["name"]})
response = client.put(urls, data={"latitude": 100},
content_type="multipart/form-data")
content_type="application/x-www-form-urlencoded")
self.assertEqual(response.status_code, HTTPStatus.BAD_REQUEST)
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