diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-11-30 12:57:47 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-11-30 12:57:47 -0500 |
commit | a09fc9740d047a11d0f464cc79d888a9c431813b (patch) | |
tree | 7070b1eaaf7e7c7f6e3783557f34219cd08c08ae /test/dialect/postgresql/test_compiler.py | |
parent | 954aafa0645f6e1ccbcfdc358a9f2930a24461a4 (diff) | |
parent | 0921a6abbc8246c57f447af7a6ac240778127fae (diff) | |
download | sqlalchemy-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.py | 13 |
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 ' |