summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHaki Benita <hakibenita@gmail.com>2026-01-08 10:06:06 +0200
committerJacob Walls <jacobtylerwalls@gmail.com>2026-01-08 11:33:52 -0500
commit459a3d17b973df23fc45328d4e976a270f0edd7f (patch)
treec59ced426dd558ba12e0977c4879081877816636 /tests
parent091ffc4e5eb35776864b853973097588a36f169e (diff)
Fixed #36852 -- Ignored index_type case in ExclusionConstraint equality check.
Diffstat (limited to 'tests')
-rw-r--r--tests/postgres_tests/test_constraints.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_constraints.py b/tests/postgres_tests/test_constraints.py
index bcc2b5f97d..331b23980d 100644
--- a/tests/postgres_tests/test_constraints.py
+++ b/tests/postgres_tests/test_constraints.py
@@ -535,6 +535,24 @@ class ExclusionConstraintTests(PostgreSQLTestCase):
],
include=["cancelled"],
)
+ constraint_8 = ExclusionConstraint(
+ index_type="gist",
+ name="exclude_overlapping",
+ expressions=[
+ ("datespan", RangeOperators.OVERLAPS),
+ ("room", RangeOperators.EQUAL),
+ ],
+ include=["cancelled"],
+ )
+ constraint_9 = ExclusionConstraint(
+ index_type="GIST",
+ name="exclude_overlapping",
+ expressions=[
+ ("datespan", RangeOperators.OVERLAPS),
+ ("room", RangeOperators.EQUAL),
+ ],
+ include=["cancelled"],
+ )
constraint_10 = ExclusionConstraint(
name="exclude_overlapping",
expressions=[
@@ -572,6 +590,8 @@ class ExclusionConstraintTests(PostgreSQLTestCase):
self.assertNotEqual(constraint_2, constraint_3)
self.assertNotEqual(constraint_2, constraint_4)
self.assertNotEqual(constraint_2, constraint_7)
+ self.assertEqual(constraint_7, constraint_8)
+ self.assertEqual(constraint_7, constraint_9)
self.assertNotEqual(constraint_4, constraint_5)
self.assertNotEqual(constraint_5, constraint_6)
self.assertNotEqual(constraint_1, object())