mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-18 04:02:35 +03:00
Add test for unique together against 3.14
This commit is contained in:
parent
2da473c8c8
commit
b401c21512
|
@ -434,6 +434,14 @@ class TestUniquenessTogetherValidation(TestCase):
|
||||||
serializer = NullUniquenessTogetherSerializer(data=data)
|
serializer = NullUniquenessTogetherSerializer(data=data)
|
||||||
assert serializer.is_valid()
|
assert serializer.is_valid()
|
||||||
|
|
||||||
|
def test_ignore_validation_for_missing_nullable_fields(self):
|
||||||
|
data = {
|
||||||
|
'date': datetime.date(2000, 1, 1),
|
||||||
|
'race_name': 'Paris Marathon',
|
||||||
|
}
|
||||||
|
serializer = NullUniquenessTogetherSerializer(data=data)
|
||||||
|
assert serializer.is_valid(), serializer.errors
|
||||||
|
|
||||||
def test_do_not_ignore_validation_for_null_fields(self):
|
def test_do_not_ignore_validation_for_null_fields(self):
|
||||||
# None values that are not on fields part of the uniqueness constraint
|
# None values that are not on fields part of the uniqueness constraint
|
||||||
# do not cause the instance to skip validation.
|
# do not cause the instance to skip validation.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user