mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-03-06 12:26:00 +03:00
Added an assertion to the tests that checks the '.errors' value for the unique-test
This commit is contained in:
parent
3f47f6cea9
commit
e7666014a8
|
@ -291,6 +291,7 @@ class ValidationTests(TestCase):
|
||||||
serializer.save()
|
serializer.save()
|
||||||
second_serializer = AlbumsSerializer(data={'title': 'a'})
|
second_serializer = AlbumsSerializer(data={'title': 'a'})
|
||||||
self.assertFalse(second_serializer.is_valid())
|
self.assertFalse(second_serializer.is_valid())
|
||||||
|
self.assertEqual(second_serializer.errors, {'title': [u'Album with this Title already exists.']})
|
||||||
|
|
||||||
|
|
||||||
class RegexValidationTest(TestCase):
|
class RegexValidationTest(TestCase):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user