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:
Simon Charette 2018-08-05 22:15:10 -04:00 committed by Tim Graham
parent 0bf7b25f8f
commit 9142bebff2
9 changed files with 34 additions and 34 deletions

View file

@ -1003,7 +1003,7 @@ class ConstraintsTests(SimpleTestCase):
age = models.IntegerField()
class Meta:
constraints = [models.CheckConstraint(models.Q(age__gte=18), 'is_adult')]
constraints = [models.CheckConstraint(check=models.Q(age__gte=18), name='is_adult')]
errors = Model.check()
warn = Warning(