From 5c188f6c1ce85eaace27f052bfd1a14f74f6a659 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 5 Feb 2014 19:25:13 -0500 Subject: - More issues with [ticket:2932] first resolved in 0.9.2 where using a column key of the form ``_`` matching that of an aliased column in the text would still not match at the ORM level, which is ultimately due to a core column-matching issue. Additional rules have been added so that the column ``_label`` is taken into account when working with a :class:`.TextAsFrom` construct or with literal columns. [ticket:2932] --- test/sql/test_query.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'test/sql/test_query.py') diff --git a/test/sql/test_query.py b/test/sql/test_query.py index 6e2227650..c20087859 100644 --- a/test/sql/test_query.py +++ b/test/sql/test_query.py @@ -1831,6 +1831,36 @@ class KeyTargetingTest(fixtures.TablesTest): assert stmt.c.a in row assert stmt.c.b in row + def test_columnclause_schema_column_four(self): + keyed2 = self.tables.keyed2 + + # this is also addressed by [ticket:2932] + + a, b = sql.column('keyed2_a'), sql.column('keyed2_b') + stmt = text("select a AS keyed2_a, b AS keyed2_b from keyed2").columns(a, b) + row = testing.db.execute(stmt).first() + + assert keyed2.c.a in row + assert keyed2.c.b in row + assert a in row + assert b in row + assert stmt.c.keyed2_a in row + assert stmt.c.keyed2_b in row + + def test_columnclause_schema_column_five(self): + keyed2 = self.tables.keyed2 + + # this is also addressed by [ticket:2932] + + stmt = text("select a AS keyed2_a, b AS keyed2_b from keyed2").columns( + keyed2_a=CHAR, keyed2_b=CHAR) + row = testing.db.execute(stmt).first() + + assert keyed2.c.a in row + assert keyed2.c.b in row + assert stmt.c.keyed2_a in row + assert stmt.c.keyed2_b in row + class LimitTest(fixtures.TestBase): -- cgit v1.2.1