diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-08-13 19:20:44 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-08-13 19:20:44 -0400 |
| commit | ea85c7053dc9532a95fd487628768fdfc1ca5c30 (patch) | |
| tree | cb4daf1166a5ef4a6dcf4d3c05da1a97882233df /test/ext | |
| parent | 44d21de457424f5623362474325aa6e5d3fe9e6d (diff) | |
| download | sqlalchemy-ea85c7053dc9532a95fd487628768fdfc1ca5c30.tar.gz | |
- The :meth:`.InspectionAttr.info` collection is now moved down to
:class:`.InspectionAttr`, where in addition to being available
on all :class:`.MapperProperty` objects, it is also now available
on hybrid properties, association proxies, when accessed via
:attr:`.Mapper.all_orm_descriptors`.
fixes #2971
Diffstat (limited to 'test/ext')
| -rw-r--r-- | test/ext/test_hybrid.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ext/test_hybrid.py b/test/ext/test_hybrid.py index e7f392a33..b895d2fb2 100644 --- a/test/ext/test_hybrid.py +++ b/test/ext/test_hybrid.py @@ -5,6 +5,7 @@ from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext import hybrid from sqlalchemy.testing import eq_, AssertsCompiledSQL, assert_raises_message from sqlalchemy.testing import fixtures +from sqlalchemy import inspect class PropertyComparatorTest(fixtures.TestBase, AssertsCompiledSQL): __dialect__ = 'default' @@ -140,6 +141,14 @@ class PropertyExpressionTest(fixtures.TestBase, AssertsCompiledSQL): return A, B + def test_info(self): + A = self._fixture() + inspect(A).all_orm_descriptors.value.info["some key"] = "some value" + eq_( + inspect(A).all_orm_descriptors.value.info, + {"some key": "some value"} + ) + def test_set_get(self): A = self._fixture() a1 = A(value=5) @@ -267,6 +276,15 @@ class MethodExpressionTest(fixtures.TestBase, AssertsCompiledSQL): "foo(a.value, :foo_1) + :foo_2" ) + def test_info(self): + A = self._fixture() + inspect(A).all_orm_descriptors.value.info["some key"] = "some value" + eq_( + inspect(A).all_orm_descriptors.value.info, + {"some key": "some value"} + ) + + def test_aliased_expression(self): A = self._fixture() self.assert_compile( |
