summaryrefslogtreecommitdiff
path: root/test/sql/test_selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-02-11 20:33:56 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2012-02-11 20:33:56 -0500
commitd934ea23e24880a5c784c9e5edf9ead5bc965a83 (patch)
tree788952f0c7e2ce44b2403ad3ab545257b6e94b77 /test/sql/test_selectable.py
parent0634ea79b1a23a8b88c886a8a3f434ed300691e2 (diff)
downloadsqlalchemy-d934ea23e24880a5c784c9e5edf9ead5bc965a83.tar.gz
- figured out again why deannotate must clone()
- got everything working. just need to update error strings
Diffstat (limited to 'test/sql/test_selectable.py')
-rw-r--r--test/sql/test_selectable.py36
1 files changed, 33 insertions, 3 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index 4f1f39014..c61760c5d 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -1151,7 +1151,37 @@ class AnnotationsTest(fixtures.TestBase):
assert b2.left is not bin.left
assert b3.left is not b2.left is not bin.left
assert b4.left is bin.left # since column is immutable
- assert b4.right is bin.right
- assert b2.right is not bin.right
- assert b3.right is b4.right is bin.right
+ # deannotate copies the element
+ assert bin.right is not b2.right is not b3.right is not b4.right
+ def test_deannotate_2(self):
+ table1 = table('table1', column("col1"), column("col2"))
+ j = table1.c.col1._annotate({"remote":True}) == \
+ table1.c.col2._annotate({"local":True})
+ j2 = sql_util._deep_deannotate(j)
+ eq_(
+ j.left._annotations, {"remote":True}
+ )
+ eq_(
+ j2.left._annotations, {}
+ )
+
+ def test_deannotate_3(self):
+ table1 = table('table1', column("col1"), column("col2"),
+ column("col3"), column("col4"))
+ j = and_(
+ table1.c.col1._annotate({"remote":True})==
+ table1.c.col2._annotate({"local":True}),
+ table1.c.col3._annotate({"remote":True})==
+ table1.c.col4._annotate({"local":True})
+ )
+ j2 = sql_util._deep_deannotate(j)
+ eq_(
+ j.clauses[0].left._annotations, {"remote":True}
+ )
+ eq_(
+ j2.clauses[0].left._annotations, {}
+ )
+
+
+