Skip to content

Commit

Permalink
Add test for unique together against 3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
browniebroke committed Sep 11, 2024
1 parent 2da473c commit b401c21
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,14 @@ def test_ignore_validation_for_null_fields(self):
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.
Expand Down

0 comments on commit b401c21

Please sign in to comment.