1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Refs #35234 -- Deprecated CheckConstraint.check in favor of .condition.

Once the deprecation period ends CheckConstraint.check() can become the
documented method that performs system checks for BaseConstraint
subclasses.
This commit is contained in:
Simon Charette
2024-02-26 00:14:26 -05:00
committed by Mariusz Felisiak
parent f82c67aa21
commit daf7d482db
21 changed files with 210 additions and 136 deletions

View File

@@ -1887,7 +1887,9 @@ class ModelStateTests(SimpleTestCase):
class Meta:
constraints = [
models.CheckConstraint(check=models.Q(size__gt=1), name="size_gt_1")
models.CheckConstraint(
condition=models.Q(size__gt=1), name="size_gt_1"
)
]
state = ModelState.from_model(ModelWithConstraints)