From c1257350ca118868bdfc867926dffad38b215162 Mon Sep 17 00:00:00 2001 From: saJaeHyukc Date: Mon, 10 Mar 2025 22:55:05 +0900 Subject: Fixed #36222 -- Fixed ExclusionConstraint validation crash on excluded fields in condition. Signed-off-by: saJaeHyukc --- tests/postgres_tests/test_constraints.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/postgres_tests') diff --git a/tests/postgres_tests/test_constraints.py b/tests/postgres_tests/test_constraints.py index 96b5d39092..f107bffcfe 100644 --- a/tests/postgres_tests/test_constraints.py +++ b/tests/postgres_tests/test_constraints.py @@ -797,6 +797,17 @@ class ExclusionConstraintTests(PostgreSQLTestCase): ), exclude={"datespan", "start", "end", "room"}, ) + # Constraints with excluded fields in condition are ignored. + constraint.validate( + HotelReservation, + HotelReservation( + datespan=(datetimes[1].date(), datetimes[2].date()), + start=datetimes[1], + end=datetimes[2], + room=room102, + ), + exclude={"cancelled"}, + ) def test_range_overlaps_custom(self): class TsTzRange(Func): -- cgit v1.3