summaryrefslogtreecommitdiff
path: root/test/sql/test_quote.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-04-10 22:33:33 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-04-10 22:33:33 -0400
commitfcda519452cf5e0cdbde7569ab32459b9f314f7a (patch)
tree4c89b5b4ca328740a83e09b5f2e2200dfc8919e8 /test/sql/test_quote.py
parent9f74861d6d2962cb255887c78d5d0f4cb8891cfa (diff)
downloadsqlalchemy-fcda519452cf5e0cdbde7569ab32459b9f314f7a.tar.gz
- Fixed regression introduced in 0.9 where new "ORDER BY <labelname>"
feature from :ticket:`1068` would not apply quoting rules to the label name as rendered in the ORDER BY. fix #3020, re: #1068
Diffstat (limited to 'test/sql/test_quote.py')
-rw-r--r--test/sql/test_quote.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/sql/test_quote.py b/test/sql/test_quote.py
index 76a789242..6a8abde0b 100644
--- a/test/sql/test_quote.py
+++ b/test/sql/test_quote.py
@@ -443,6 +443,15 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL):
'"Anon".Col1 = :Col1_1'
)
+ def test_simple_order_by_label(self):
+ m = MetaData()
+ t1 = Table('t1', m, Column('col1', Integer))
+ cl = t1.c.col1.label('ShouldQuote')
+ self.assert_compile(
+ select([cl]).order_by(cl),
+ 'SELECT t1.col1 AS "ShouldQuote" FROM t1 ORDER BY "ShouldQuote"'
+ )
+
def test_join(self):
# Lower case names, should not quote
metadata = MetaData()