From d66f470326c59330e323ad470d6014d2adbba729 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 3 Jan 2010 18:53:41 +0000 Subject: fixed DDL quoting with literal strings that have ' [ticket:1640] --- test/dialect/test_postgresql.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/dialect/test_postgresql.py') 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): -- cgit v1.2.1