summaryrefslogtreecommitdiff
path: root/test/sql/test_text.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-02-26 13:28:14 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-02-26 13:28:14 -0500
commitbf67069d264cba3feed8a48614289d605ed61a55 (patch)
tree3101f06439d9c9ab6a3f7dee1ab48cc5707d6f16 /test/sql/test_text.py
parent6fadb57165248e7142ba8b4d1f3e32fa77054528 (diff)
downloadsqlalchemy-bf67069d264cba3feed8a48614289d605ed61a55.tar.gz
- Fixed issue in new :meth:`.TextClause.columns` method where the ordering
of columns given positionally would not be preserved. This could have potential impact in positional situations such as applying the resulting :class:`.TextAsFrom` object to a union.
Diffstat (limited to 'test/sql/test_text.py')
-rw-r--r--test/sql/test_text.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/sql/test_text.py b/test/sql/test_text.py
index 57dadfb16..ef63f9daa 100644
--- a/test/sql/test_text.py
+++ b/test/sql/test_text.py
@@ -322,6 +322,20 @@ class AsFromTest(fixtures.TestBase, AssertsCompiledSQL):
}
)
+ def test_column_collection_ordered(self):
+ t = text("select a, b, c from foo").columns(column('a'),
+ column('b'), column('c'))
+ eq_(t.c.keys(), ['a', 'b', 'c'])
+
+ def test_column_collection_pos_plus_bykey(self):
+ # overlapping positional names + type names
+ t = text("select a, b, c from foo").columns(column('a'),
+ column('b'), b=Integer, c=String)
+ eq_(t.c.keys(), ['a', 'b', 'c'])
+ eq_(t.c.b.type._type_affinity, Integer)
+ eq_(t.c.c.type._type_affinity, String)
+
+
def _xy_table_fixture(self):
m = MetaData()
t = Table('t', m, Column('x', Integer), Column('y', Integer))