diff --git a/demo/tests/test_integration.py b/demo/tests/test_integration.py index 25420de1..270178b0 100644 --- a/demo/tests/test_integration.py +++ b/demo/tests/test_integration.py @@ -409,8 +409,9 @@ def test_validate_data_ok(self): parameters, format='json' ) self.assertEqual(res.status_code, 204) + self.assertIn('application/json', str(res.serialize_headers())) - def test_validate_does_not_exist(self): + def test_formidable_does_not_exist(self): parameters = { 'first_name': 'Guillaume', 'last_name': 'GĂ©rard', @@ -438,6 +439,7 @@ def test_validate_data_ko(self): self.assertEqual(res.status_code, 400) errors = res.data self.assertIn('first_name', errors) + self.assertIn('application/json', str(res.serialize_headers())) def test_validate_with_mandatory_file(self): class WithFile(FormidableForm): diff --git a/formidable/views.py b/formidable/views.py index d5d752dc..fbc91f66 100644 --- a/formidable/views.py +++ b/formidable/views.py @@ -266,7 +266,7 @@ def get_form_class_kwargs(self): } def form_valid(self, form): - return Response(status=204) + return Response({}, status=204) def form_invalid(self, form): # TODO change response when UI ready