diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-03 18:53:41 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-03 18:53:41 +0000 |
commit | d66f470326c59330e323ad470d6014d2adbba729 (patch) | |
tree | 055654aba24c9acfd6ac37a8f601f44ef84d8560 /test/dialect/test_postgresql.py | |
parent | cae83dd7ea9b847961b4df3227bc829b62510640 (diff) | |
download | sqlalchemy-d66f470326c59330e323ad470d6014d2adbba729.tar.gz |
fixed DDL quoting with literal strings that have ' [ticket:1640]
Diffstat (limited to 'test/dialect/test_postgresql.py')
-rw-r--r-- | test/dialect/test_postgresql.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py index bc181810e..9833042fe 100644 --- a/test/dialect/test_postgresql.py +++ b/test/dialect/test_postgresql.py @@ -87,9 +87,16 @@ class CompileTest(TestBase, AssertsCompiledSQL): m = MetaData() tbl = Table('testtbl', m, Column('data',Integer)) idx = Index('test_idx1', tbl.c.data, postgresql_where=and_(tbl.c.data > 5, tbl.c.data < 10)) + idx = Index('test_idx1', tbl.c.data, postgresql_where=and_(tbl.c.data > 5, tbl.c.data < 10)) + + # test quoting and all that + idx2 = Index('test_idx2', tbl.c.data, postgresql_where=and_(tbl.c.data > 'a', tbl.c.data < "b's")) self.assert_compile(schema.CreateIndex(idx), "CREATE INDEX test_idx1 ON testtbl (data) WHERE data > 5 AND data < 10", dialect=postgresql.dialect()) + + self.assert_compile(schema.CreateIndex(idx2), + "CREATE INDEX test_idx2 ON testtbl (data) WHERE data > 'a' AND data < 'b''s'", dialect=postgresql.dialect()) @testing.uses_deprecated(r".*'postgres_where' argument has been renamed.*") def test_old_create_partial_index(self): |