1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Refs #34701 -- Moved UniqueConstraint(nulls_distinct) validation tests.

The original tests required the creation of a model that is no longer necessary
and were exercising Model.full_clean(validate_constraints) which has nothing
to do with the nulls_distinct feature.
This commit is contained in:
Simon Charette
2024-07-13 22:15:21 -04:00
committed by Sarah Boyce
parent adc0b6aac3
commit 0e49a8c3bd
3 changed files with 13 additions and 37 deletions

View File

@@ -217,17 +217,3 @@ class UniqueConstraintConditionProduct(models.Model):
condition=models.Q(color__isnull=True),
),
]
class UniqueConstraintNullsDistinctProduct(models.Model):
name = models.CharField(max_length=255, blank=True, null=True)
class Meta:
required_db_features = {"supports_nulls_distinct_unique_constraints"}
constraints = [
models.UniqueConstraint(
fields=["name"],
name="name_nulls_not_distinct_uniq",
nulls_distinct=False,
),
]