summaryrefslogtreecommitdiff
path: root/test/sql/test_selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-05-25 11:32:07 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-05-25 11:32:36 -0400
commitd91da90d96f8f1afabc5225445a24a01867bade2 (patch)
treefc469e32ea2f938004e687cf9537f0ace6e950e5 /test/sql/test_selectable.py
parent9f5fe59107f3d67cb3453f7921256123e109842b (diff)
downloadsqlalchemy-d91da90d96f8f1afabc5225445a24a01867bade2.tar.gz
- Fixed bug in SQLite join rewriting where anonymized column names
due to repeats would not correctly be rewritten in subqueries. This would affect SELECT queries with any kind of subquery + join. fixes #3057
Diffstat (limited to 'test/sql/test_selectable.py')
-rw-r--r--test/sql/test_selectable.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index ed97bb37f..3ee8127b6 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -1549,6 +1549,19 @@ class AnnotationsTest(fixtures.TestBase):
t = Table('t', MetaData(), c1)
is_(c1_a.table, t)
+ def test_basic_attrs(self):
+ t = Table('t', MetaData(),
+ Column('x', Integer, info={'q': 'p'}),
+ Column('y', Integer, key='q'))
+ x_a = t.c.x._annotate({})
+ y_a = t.c.q._annotate({})
+ t.c.x.info['z'] = 'h'
+
+ eq_(y_a.key, 'q')
+ is_(x_a.table, t)
+ eq_(x_a.info, {'q': 'p', 'z': 'h'})
+ eq_(t.c.x.anon_label, x_a.anon_label)
+
def test_custom_constructions(self):
from sqlalchemy.schema import Column
class MyColumn(Column):