mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Add test for unique together in a better place
This commit is contained in:
parent
81c74d903d
commit
2bf6c7df6d
|
@ -441,6 +441,14 @@ class TestUniquenessTogetherValidation(TestCase):
|
|||
serializer = NullUniquenessTogetherSerializer(data=data)
|
||||
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):
|
||||
# None values that are not on fields part of the uniqueness constraint
|
||||
# do not cause the instance to skip validation.
|
||||
|
|
Loading…
Reference in New Issue
Block a user