diff options
Diffstat (limited to 'djangorestframework')
| -rw-r--r-- | djangorestframework/resources.py | 2 | ||||
| -rw-r--r-- | djangorestframework/tests/validators.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/djangorestframework/resources.py b/djangorestframework/resources.py index bf9af6f0..68b285b9 100644 --- a/djangorestframework/resources.py +++ b/djangorestframework/resources.py @@ -173,7 +173,7 @@ class FormResource(Resource): field_errors[key] = [u'This field does not exist.'] if field_errors: - detail[u'field-errors'] = field_errors + detail[u'field_errors'] = field_errors # Return HTTP 400 response (BAD REQUEST) raise ErrorResponse(400, detail) diff --git a/djangorestframework/tests/validators.py b/djangorestframework/tests/validators.py index 1f696422..18c8c313 100644 --- a/djangorestframework/tests/validators.py +++ b/djangorestframework/tests/validators.py @@ -149,7 +149,7 @@ class TestFormValidation(TestCase): try: validator.validate_request(content, None) except ErrorResponse, exc: - self.assertEqual(exc.response.raw_content, {'field-errors': {'qwerty': ['This field is required.']}}) + self.assertEqual(exc.response.raw_content, {'field_errors': {'qwerty': ['This field is required.']}}) else: self.fail('ResourceException was not raised') #pragma: no cover @@ -159,7 +159,7 @@ class TestFormValidation(TestCase): try: validator.validate_request(content, None) except ErrorResponse, exc: - self.assertEqual(exc.response.raw_content, {'field-errors': {'qwerty': ['This field is required.']}}) + self.assertEqual(exc.response.raw_content, {'field_errors': {'qwerty': ['This field is required.']}}) else: self.fail('ResourceException was not raised') #pragma: no cover @@ -169,7 +169,7 @@ class TestFormValidation(TestCase): try: validator.validate_request(content, None) except ErrorResponse, exc: - self.assertEqual(exc.response.raw_content, {'field-errors': {'extra': ['This field does not exist.']}}) + self.assertEqual(exc.response.raw_content, {'field_errors': {'extra': ['This field does not exist.']}}) else: self.fail('ResourceException was not raised') #pragma: no cover @@ -179,7 +179,7 @@ class TestFormValidation(TestCase): try: validator.validate_request(content, None) except ErrorResponse, exc: - self.assertEqual(exc.response.raw_content, {'field-errors': {'qwerty': ['This field is required.'], + self.assertEqual(exc.response.raw_content, {'field_errors': {'qwerty': ['This field is required.'], 'extra': ['This field does not exist.']}}) else: self.fail('ResourceException was not raised') #pragma: no cover |
