1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[4.1.x] Fixed #33996 -- Fixed CheckConstraint validation on NULL values.

Bug in 667105877e.

Thanks James Beith for the report.

Backport of e14d08cd89 from main
This commit is contained in:
David Sanders
2022-09-09 00:02:58 +10:00
committed by Mariusz Felisiak
parent 148d60de74
commit be5e3b46f7
7 changed files with 42 additions and 7 deletions

View File

@@ -146,9 +146,7 @@ class SchemaTests(PostgreSQLTestCase):
check=Q(ints__startswith__gte=0),
name="ints_positive_range",
)
msg = f"Constraint “{constraint.name}” is violated."
with self.assertRaisesMessage(ValidationError, msg):
constraint.validate(RangesModel, RangesModel())
constraint.validate(RangesModel, RangesModel())
def test_opclass(self):
constraint = UniqueConstraint(