aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests
diff options
context:
space:
mode:
authorJohn Whitlock2014-08-13 15:31:25 -0500
committerJohn Whitlock2014-08-13 15:31:25 -0500
commit34c1da3515dbf4e9a0d645ebf81cde6f61254e31 (patch)
treecc43de826817132f5c9e6875ed1ed84825cd1615 /rest_framework/tests
parentc52075f392420356c471860dc07f9371002efe39 (diff)
downloaddjango-rest-framework-34c1da3515dbf4e9a0d645ebf81cde6f61254e31.tar.bz2
ModelSerializer.restore_object - errors as list
When a ValueError is raised in ModelSerializer.restore_object, the error is set to a one-element list, rather than a bare string.
Diffstat (limited to 'rest_framework/tests')
-rw-r--r--rest_framework/tests/test_serializer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/rest_framework/tests/test_serializer.py b/rest_framework/tests/test_serializer.py
index 91248ce7..fb2eac0b 100644
--- a/rest_framework/tests/test_serializer.py
+++ b/rest_framework/tests/test_serializer.py
@@ -685,7 +685,7 @@ class ModelValidationTests(TestCase):
photo_serializer = PhotoSerializer(instance=photo, data={'album': ''}, partial=True)
self.assertFalse(photo_serializer.is_valid())
self.assertTrue('album' in photo_serializer.errors)
- self.assertEqual(photo_serializer.errors['album'], photo_serializer.error_messages['required'])
+ self.assertEqual(photo_serializer.errors['album'], [photo_serializer.error_messages['required']])
def test_foreign_key_with_partial(self):
"""