mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 17:09:59 +03:00
Test UniqueTogetherValidator error+source
This commit is contained in:
parent
32c987517b
commit
0c43371d89
|
@ -335,6 +335,15 @@ class TestUniquenessTogetherValidation(TestCase):
|
||||||
serializer = WriteableSerializer(data={'name': 'test', 'position': 1})
|
serializer = WriteableSerializer(data={'name': 'test', 'position': 1})
|
||||||
assert serializer.is_valid(raise_exception=True)
|
assert serializer.is_valid(raise_exception=True)
|
||||||
|
|
||||||
|
# Validation error should use seriazlier field name, not source
|
||||||
|
serializer = WriteableSerializer(data={'position': 1})
|
||||||
|
assert not serializer.is_valid()
|
||||||
|
assert serializer.errors == {
|
||||||
|
'name': [
|
||||||
|
'This field is required.'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
def test_allow_explict_override(self):
|
def test_allow_explict_override(self):
|
||||||
"""
|
"""
|
||||||
Ensure validators can be explicitly removed..
|
Ensure validators can be explicitly removed..
|
||||||
|
|
Loading…
Reference in New Issue
Block a user