Added an assertion to the tests that checks the '.errors' value for the unique-test

This commit is contained in:
Marko Tibold 2012-11-26 23:39:49 +01:00
parent 3f47f6cea9
commit e7666014a8

View File

@ -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):