summaryrefslogtreecommitdiff
path: root/test/orm/test_query.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-11-13 11:55:54 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2013-11-13 11:55:54 -0500
commitfefa2f5d57301f86136233a485624f0d083236d9 (patch)
tree7e504aaa52db476eb5cfe549a857902c6bd09b67 /test/orm/test_query.py
parentfe1d64473896b1e8abeb8ddb966447632c057321 (diff)
downloadsqlalchemy-fefa2f5d57301f86136233a485624f0d083236d9.tar.gz
Fixed bug where usage of new :class:`.Bundle` object would cause
the :attr:`.Query.column_descriptions` attribute to fail.
Diffstat (limited to 'test/orm/test_query.py')
-rw-r--r--test/orm/test_query.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/orm/test_query.py b/test/orm/test_query.py
index 63e3c4bb9..4d276896c 100644
--- a/test/orm/test_query.py
+++ b/test/orm/test_query.py
@@ -19,7 +19,7 @@ from sqlalchemy.testing.assertions import eq_, assert_raises, assert_raises_mess
from sqlalchemy.testing import AssertsCompiledSQL
from test.orm import _fixtures
from sqlalchemy.testing import fixtures, engines
-
+from sqlalchemy.orm import Bundle
from sqlalchemy.orm.util import join, outerjoin, with_parent
class QueryTest(_fixtures.FixtureTest):
@@ -74,6 +74,7 @@ class RowTupleTest(QueryTest):
address_alias = aliased(Address, name='aalias')
fn = func.count(User.id)
name_label = User.name.label('uname')
+ bundle = Bundle('b1', User.id, User.name)
for q, asserted in [
(
sess.query(User),
@@ -112,6 +113,15 @@ class RowTupleTest(QueryTest):
'expr':fn
},
]
+ ),
+ (
+ sess.query(bundle),
+ [
+ {'aliased': False,
+ 'expr': bundle,
+ 'type': Bundle,
+ 'name': 'b1'}
+ ]
)
]:
eq_(
@@ -119,6 +129,7 @@ class RowTupleTest(QueryTest):
asserted
)
+
def test_unhashable_type(self):
from sqlalchemy.types import TypeDecorator, Integer
from sqlalchemy.sql import type_coerce