summaryrefslogtreecommitdiff
path: root/test/sql/test_selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-09-21 17:08:08 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-09-21 17:08:08 -0400
commit9d775a4cd4b8f66baa0f0256059fd547894f0813 (patch)
tree4e2099332788a1d3f573626908968f122047b503 /test/sql/test_selectable.py
parent2aa80d40d2c9a00bb87a145bba1f01c327b6000b (diff)
downloadsqlalchemy-9d775a4cd4b8f66baa0f0256059fd547894f0813.tar.gz
- Fixed bug whereby with_only_columns() method of
Select would fail if a selectable were passed. [ticket:2270]. Also in 0.6.9.
Diffstat (limited to 'test/sql/test_selectable.py')
-rw-r--r--test/sql/test_selectable.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index 4bbcf61d2..9a9fc0de9 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -127,6 +127,14 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
sel3 = visitors.ReplacingCloningVisitor().traverse(sel2)
assert sel3.corresponding_column(col) is sel3.c.foo
+ def test_with_only_generative(self):
+ s1 = table1.select().as_scalar()
+ self.assert_compile(
+ s1.with_only_columns([s1]),
+ "SELECT (SELECT table1.col1, table1.col2, "
+ "table1.col3, table1.colx FROM table1) AS anon_1"
+ )
+
def test_select_on_table(self):
sel = select([table1, table2], use_labels=True)