summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2017-04-03 12:37:35 -0400
committerGerrit Code Review <gerrit@awstats.zzzcomputing.com>2017-04-03 12:37:35 -0400
commit6dfc5b36b86948dc115a4ce3b6d24d3dae551d70 (patch)
treea18368e90ee6ef593120dfb0f6fd31f9081263e1 /test/sql
parent6d7d48af0dec6325f87ce497f769827107ad5035 (diff)
parent7bb4923391f98db517dde59d813322a948d10bfe (diff)
downloadsqlalchemy-6dfc5b36b86948dc115a4ce3b6d24d3dae551d70.tar.gz
Merge "Use consistent method signature for Alias.self_group()"
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_selectable.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index d38ee0e8a..0cbaf33ea 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -333,6 +333,20 @@ class SelectableTest(
criterion = a.c.col1 == table2.c.col2
self.assert_(criterion.compare(j.onclause))
+ def test_alias_handles_column_context(self):
+ # not quite a use case yet but this is expected to become
+ # prominent w/ Postgresql's tuple functions
+
+ stmt = select([table1.c.col1, table1.c.col2])
+ a = stmt.alias('a')
+ self.assert_compile(
+ select([func.foo(a)]),
+ "SELECT foo(SELECT table1.col1, table1.col2 FROM table1) "
+ "AS foo_1 FROM "
+ "(SELECT table1.col1 AS col1, table1.col2 AS col2 FROM table1) "
+ "AS a"
+ )
+
def test_union(self):
# tests that we can correspond a column in a Select statement