summaryrefslogtreecommitdiff
path: root/test/sql/test_selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-07-24 20:41:42 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-07-24 20:41:42 -0400
commit5c7cc274250c54430d9dceb05ad2a4a33e2378d7 (patch)
tree44afa2213090a2f19fccd3951de70a961008c83c /test/sql/test_selectable.py
parent027725fc49df85d3d9628a006b1c648a6b93f8c3 (diff)
downloadsqlalchemy-5c7cc274250c54430d9dceb05ad2a4a33e2378d7.tar.gz
- rework Annotated to no longer use __cmp__(), supply an __eq__() that
works with ColumnElement as well as works with non-__eq__() suppliers, works with sets, on Py3K as well.
Diffstat (limited to 'test/sql/test_selectable.py')
-rw-r--r--test/sql/test_selectable.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index 555271f16..82d018af1 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -846,6 +846,24 @@ class DerivedTest(fixtures.TestBase, AssertsExecutionResults):
assert not t2.select().alias('foo').is_derived_from(t1)
class AnnotationsTest(fixtures.TestBase):
+
+ def test_hashing(self):
+ t = table('t', column('x'))
+
+ a = t.alias()
+ s = t.select()
+ s2 = a.select()
+
+ for obj in [
+ t,
+ t.c.x,
+ a,
+ s,
+ s2
+ ]:
+ annot = obj._annotate({})
+ eq_(set([obj]), set([annot]))
+
def test_custom_constructions(self):
from sqlalchemy.schema import Column
class MyColumn(Column):