diff options
| author | Simon Charette <charette.s@gmail.com> | 2024-02-26 00:14:26 -0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2024-03-01 07:15:32 +0100 |
| commit | daf7d482dbaaa2604241a994c49f442fa15142c1 (patch) | |
| tree | 65eae557dbe8694e03130cc17259a792792c95b7 /tests/postgres_tests/test_operations.py | |
| parent | f82c67aa217c8dd4320ef697b04a6da1681aa799 (diff) | |
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.
Diffstat (limited to 'tests/postgres_tests/test_operations.py')
| -rw-r--r-- | tests/postgres_tests/test_operations.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/postgres_tests/test_operations.py b/tests/postgres_tests/test_operations.py index bc2ae42096..5780348251 100644 --- a/tests/postgres_tests/test_operations.py +++ b/tests/postgres_tests/test_operations.py @@ -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") |
