summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-11-30 12:57:47 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2015-11-30 12:57:47 -0500
commita09fc9740d047a11d0f464cc79d888a9c431813b (patch)
tree7070b1eaaf7e7c7f6e3783557f34219cd08c08ae /test/dialect/postgresql/test_compiler.py
parent954aafa0645f6e1ccbcfdc358a9f2930a24461a4 (diff)
parent0921a6abbc8246c57f447af7a6ac240778127fae (diff)
downloadsqlalchemy-a09fc9740d047a11d0f464cc79d888a9c431813b.tar.gz
Merge remote-tracking branch 'origin/pr/215'
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r--test/dialect/postgresql/test_compiler.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index 78217bd82..13acf8c86 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -510,6 +510,19 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
'(CAST("Room" AS TEXT) WITH =)'
)
+ def test_exclude_constraint_when(self):
+ m = MetaData()
+ tbl = Table(
+ 'testtbl', m,
+ Column('room', String)
+ )
+ cons = ExcludeConstraint(('room', '='), where=tbl.c.room.in_(['12']))
+ tbl.append_constraint(cons)
+ self.assert_compile(schema.AddConstraint(cons),
+ 'ALTER TABLE testtbl ADD EXCLUDE USING gist '
+ '(room WITH =) WHERE (testtbl.room IN (\'12\'))',
+ dialect=postgresql.dialect())
+
def test_substring(self):
self.assert_compile(func.substring('abc', 1, 2),
'SUBSTRING(%(substring_1)s FROM %(substring_2)s '