summaryrefslogtreecommitdiff
path: root/test/sql/test_quote.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-07-17 11:18:59 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-07-17 11:18:59 -0400
commit0a54a4a4b0897bb8eaaf7a7857fb54924ccbd7ef (patch)
tree720aad2b844dbf821d339d365aa77777c7168f3e /test/sql/test_quote.py
parentc59199c9879c3535dc48647a3f61281f0ac631f4 (diff)
downloadsqlalchemy-0a54a4a4b0897bb8eaaf7a7857fb54924ccbd7ef.tar.gz
Fixed bug in :class:`.CheckConstraint` DDL where the "quote" flag from a
:class:`.Column` object would not be propagated. Also in 0.8.3, 0.7.11. [ticket:2784]
Diffstat (limited to 'test/sql/test_quote.py')
-rw-r--r--test/sql/test_quote.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/sql/test_quote.py b/test/sql/test_quote.py
index 717f0f797..c92f1ac80 100644
--- a/test/sql/test_quote.py
+++ b/test/sql/test_quote.py
@@ -542,6 +542,28 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL):
'Foo.T1'
)
+ def test_quote_flag_propagate_check_constraint(self):
+ m = MetaData()
+ t = Table('t', m, Column('x', Integer, quote=True))
+ CheckConstraint(t.c.x > 5)
+ self.assert_compile(
+ schema.CreateTable(t),
+ "CREATE TABLE t ("
+ '"x" INTEGER, '
+ 'CHECK ("x" > 5)'
+ ")"
+ )
+
+ def test_quote_flag_propagate_index(self):
+ m = MetaData()
+ t = Table('t', m, Column('x', Integer, quote=True))
+ idx = Index("foo", t.c.x)
+ self.assert_compile(
+ schema.CreateIndex(idx),
+ 'CREATE INDEX foo ON t ("x")'
+ )
+
+
class PreparerTest(fixtures.TestBase):
"""Test the db-agnostic quoting services of IdentifierPreparer."""
@@ -596,3 +618,4 @@ class PreparerTest(fixtures.TestBase):
a_eq(unformat('foo.`bar`'), ['foo', 'bar'])
a_eq(unformat('`foo`.bar'), ['foo', 'bar'])
a_eq(unformat('`foo`.`b``a``r`.`baz`'), ['foo', 'b`a`r', 'baz'])
+