Skip to content

Commit

Permalink
refs #257, Add default dict to have right content-type
Browse files Browse the repository at this point in the history
  • Loading branch information
moumoutte committed Sep 7, 2017
1 parent e4f92e8 commit 1955fe6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion demo/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion formidable/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1955fe6

Please sign in to comment.