summaryrefslogtreecommitdiff
path: root/test/sql/test_query.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-04-24 11:24:23 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-04-24 11:24:23 -0400
commit9b73e997b2325018555268e1f1069e88e80fdb85 (patch)
tree6cd512b1a8395f8dd9edb5915323603ef108db70 /test/sql/test_query.py
parent3d4c6f68167d33b28e0c3b12032058ad0d807d58 (diff)
downloadsqlalchemy-9b73e997b2325018555268e1f1069e88e80fdb85.tar.gz
- [bug] The names of the columns on the
.c. attribute of a select().apply_labels() is now based on <tablename>_<colkey> instead of <tablename>_<colname>, for those columns that have a distinctly named .key. [ticket:2397]
Diffstat (limited to 'test/sql/test_query.py')
-rw-r--r--test/sql/test_query.py38
1 files changed, 1 insertions, 37 deletions
diff --git a/test/sql/test_query.py b/test/sql/test_query.py
index 9f0c2dab0..f315d6621 100644
--- a/test/sql/test_query.py
+++ b/test/sql/test_query.py
@@ -1280,7 +1280,7 @@ class KeyTargetingTest(fixtures.TablesTest):
keyed2 = self.tables.keyed2
row = testing.db.execute(select([keyed1, keyed2])).first()
- # without #2397, row.b is unambiguous
+ # row.b is unambiguous
eq_(row.b, "b2")
# row.a is ambiguous
assert_raises_message(
@@ -1289,21 +1289,6 @@ class KeyTargetingTest(fixtures.TablesTest):
getattr, row, "a"
)
- @testing.fails_if(lambda: True, "Possible future behavior")
- def test_keyed_accessor_composite_conflict_2397(self):
- keyed1 = self.tables.keyed1
- keyed2 = self.tables.keyed2
-
- row = testing.db.execute(select([keyed1, keyed2])).first()
- # with #2397, row.a is unambiguous
- eq_(row.a, "a2")
- # row.b is ambiguous
- assert_raises_message(
- exc.InvalidRequestError,
- "Ambiguous column name 'b'",
- getattr, row, 'b'
- )
-
def test_keyed_accessor_composite_names_precedent(self):
keyed1 = self.tables.keyed1
keyed4 = self.tables.keyed4
@@ -1328,17 +1313,6 @@ class KeyTargetingTest(fixtures.TablesTest):
)
eq_(row.d, "d3")
- @testing.fails_if(lambda: True, "Possible future behavior")
- def test_keyed_accessor_composite_2397(self):
- keyed1 = self.tables.keyed1
- keyed3 = self.tables.keyed3
-
- row = testing.db.execute(select([keyed1, keyed3])).first()
- eq_(row.b, "a1")
- eq_(row.q, "c1")
- eq_(row.a, "a3")
- eq_(row.d, "d3")
-
def test_keyed_accessor_composite_labeled(self):
keyed1 = self.tables.keyed1
keyed2 = self.tables.keyed2
@@ -1366,22 +1340,12 @@ class KeyTargetingTest(fixtures.TablesTest):
assert sql.column('content_type') in row
def test_column_label_overlap_fallback_2(self):
- # this fails with #2397
content, bar = self.tables.content, self.tables.bar
row = testing.db.execute(content.select(use_labels=True)).first()
assert content.c.type in row
assert bar.c.content_type not in row
assert sql.column('content_type') not in row
- @testing.fails_if(lambda: True, "Possible future behavior")
- def test_column_label_overlap_fallback_3(self):
- # this passes with #2397
- content, bar = self.tables.content, self.tables.bar
- row = testing.db.execute(content.select(use_labels=True)).first()
- assert content.c.type in row
- assert bar.c.content_type not in row
- assert sql.column('content_type') in row
-
class LimitTest(fixtures.TestBase):