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/check_framework/test_model_checks.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/check_framework/test_model_checks.py')
| -rw-r--r-- | tests/check_framework/test_model_checks.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/check_framework/test_model_checks.py b/tests/check_framework/test_model_checks.py index 3075a61be8..be504f9c2d 100644 --- a/tests/check_framework/test_model_checks.py +++ b/tests/check_framework/test_model_checks.py @@ -287,8 +287,8 @@ class ConstraintNameTests(TestCase): class Model(models.Model): class Meta: constraints = [ - models.CheckConstraint(check=models.Q(id__gt=0), name="foo"), - models.CheckConstraint(check=models.Q(id__lt=100), name="foo"), + models.CheckConstraint(condition=models.Q(id__gt=0), name="foo"), + models.CheckConstraint(condition=models.Q(id__lt=100), name="foo"), ] self.assertEqual( @@ -303,7 +303,7 @@ class ConstraintNameTests(TestCase): ) def test_collision_in_different_models(self): - constraint = models.CheckConstraint(check=models.Q(id__gt=0), name="foo") + constraint = models.CheckConstraint(condition=models.Q(id__gt=0), name="foo") class Model1(models.Model): class Meta: @@ -328,7 +328,7 @@ class ConstraintNameTests(TestCase): class AbstractModel(models.Model): class Meta: constraints = [ - models.CheckConstraint(check=models.Q(id__gt=0), name="foo") + models.CheckConstraint(condition=models.Q(id__gt=0), name="foo") ] abstract = True @@ -354,7 +354,7 @@ class ConstraintNameTests(TestCase): class Meta: constraints = [ models.CheckConstraint( - check=models.Q(id__gt=0), name="%(app_label)s_%(class)s_foo" + condition=models.Q(id__gt=0), name="%(app_label)s_%(class)s_foo" ), ] abstract = True @@ -370,7 +370,7 @@ class ConstraintNameTests(TestCase): @modify_settings(INSTALLED_APPS={"append": "basic"}) @isolate_apps("basic", "check_framework", kwarg_name="apps") def test_collision_across_apps(self, apps): - constraint = models.CheckConstraint(check=models.Q(id__gt=0), name="foo") + constraint = models.CheckConstraint(condition=models.Q(id__gt=0), name="foo") class Model1(models.Model): class Meta: @@ -397,7 +397,7 @@ class ConstraintNameTests(TestCase): @isolate_apps("basic", "check_framework", kwarg_name="apps") def test_no_collision_across_apps_interpolation(self, apps): constraint = models.CheckConstraint( - check=models.Q(id__gt=0), name="%(app_label)s_%(class)s_foo" + condition=models.Q(id__gt=0), name="%(app_label)s_%(class)s_foo" ) class Model1(models.Model): |
