This commit is contained in:
Marko Tibold 2012-11-16 21:42:04 +01:00
parent c5765641a4
commit 4edc801d59

View File

@ -239,6 +239,14 @@ class ValidationTests(TestCase):
self.assertEquals(serializer.is_valid(), True) self.assertEquals(serializer.is_valid(), True)
self.assertEquals(serializer.errors, {}) self.assertEquals(serializer.errors, {})
def test_modelserializer_max_length_exceeded(self):
data = {
'title': 'x' * 201,
}
serializer = ActionItemSerializer(data=data)
self.assertEquals(serializer.is_valid(), False)
self.assertEquals(serializer.errors, {'content': [u'Ensure this value has at most 200 characters (it has 201).']})
class MetadataTests(TestCase): class MetadataTests(TestCase):
def test_empty(self): def test_empty(self):