diff --git a/tests/test_validators.py b/tests/test_validators.py index 39490ac863..c0047dc73f 100644 --- a/tests/test_validators.py +++ b/tests/test_validators.py @@ -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.