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 Oct 3, 2017
1 parent 6483aee commit cfb5d1e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ChangeLog
master (unreleased)
===================

Nothing here yet.
- Validation View return the right content-type headers when the validation is okay (#257)
- Fix The error 500 when the formidable object is not found on validation view (#257)

Release 1.0.0 (2017-09-08)
==========================
Expand Down
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 cfb5d1e

Please sign in to comment.