mirror of
https://github.com/django/django.git
synced 2025-08-02 18:13:02 +00:00
Refs #11964 -- Changed CheckConstraint() signature to use keyword-only arguments.
Also renamed the `constraint` argument to `check` to better represent which part of the constraint the provided `Q` object represents.
This commit is contained in:
parent
0bf7b25f8f
commit
9142bebff2
9 changed files with 34 additions and 34 deletions
|
@ -1143,7 +1143,7 @@ class ModelStateTests(SimpleTestCase):
|
|||
size = models.IntegerField()
|
||||
|
||||
class Meta:
|
||||
constraints = [models.CheckConstraint(models.Q(size__gt=1), 'size_gt_1')]
|
||||
constraints = [models.CheckConstraint(check=models.Q(size__gt=1), name='size_gt_1')]
|
||||
|
||||
state = ModelState.from_model(ModelWithConstraints)
|
||||
model_constraints = ModelWithConstraints._meta.constraints
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue