mirror of
https://github.com/django/django.git
synced 2025-07-28 15:44:20 +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:
parent
f82c67aa21
commit
daf7d482db
21 changed files with 210 additions and 136 deletions
|
@ -496,7 +496,7 @@ class AddConstraintNotValidTests(OperationTestBase):
|
|||
def test_add(self):
|
||||
table_name = f"{self.app_label}_pony"
|
||||
constraint_name = "pony_pink_gte_check"
|
||||
constraint = CheckConstraint(check=Q(pink__gte=4), name=constraint_name)
|
||||
constraint = CheckConstraint(condition=Q(pink__gte=4), name=constraint_name)
|
||||
operation = AddConstraintNotValid("Pony", constraint=constraint)
|
||||
project_state, new_state = self.make_test_state(self.app_label, operation)
|
||||
self.assertEqual(
|
||||
|
@ -549,7 +549,7 @@ class ValidateConstraintTests(OperationTestBase):
|
|||
|
||||
def test_validate(self):
|
||||
constraint_name = "pony_pink_gte_check"
|
||||
constraint = CheckConstraint(check=Q(pink__gte=4), name=constraint_name)
|
||||
constraint = CheckConstraint(condition=Q(pink__gte=4), name=constraint_name)
|
||||
operation = AddConstraintNotValid("Pony", constraint=constraint)
|
||||
project_state, new_state = self.make_test_state(self.app_label, operation)
|
||||
Pony = new_state.apps.get_model(self.app_label, "Pony")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue