mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Additional test for 'source' behaviour. Refs #1302
This commit is contained in:
parent
a439c80cd8
commit
71ab7cda2a
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user