Additional test for 'source' behaviour. Refs #1302

This commit is contained in:
Tom Christie 2013-12-21 21:54:51 +00:00
parent a439c80cd8
commit 71ab7cda2a

View File

@ -75,6 +75,10 @@ class TestCustomValidationMethods(TestCase):
self.assertFalse(serializer.is_valid())
self.assertIn('renamed', serializer.errors)
def test_custom_validation_method_passing(self):
serializer = ShouldValidateModelSerializer(data={'renamed': 'foo'})
self.assertTrue(serializer.is_valid())
class ValidationSerializer(serializers.Serializer):
foo = serializers.CharField()