summaryrefslogtreecommitdiff
path: root/test/ext/declarative/test_basic.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/ext/declarative/test_basic.py')
-rw-r--r--test/ext/declarative/test_basic.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ext/declarative/test_basic.py b/test/ext/declarative/test_basic.py
index 5165d9cc9..ae1a85f8b 100644
--- a/test/ext/declarative/test_basic.py
+++ b/test/ext/declarative/test_basic.py
@@ -102,6 +102,29 @@ class DeclarativeTest(DeclarativeTestBase):
assert User.addresses.property.mapper.class_ is Address
+ def test_unicode_string_resolve_backref(self):
+ class User(Base, fixtures.ComparableEntity):
+ __tablename__ = 'users'
+
+ id = Column('id', Integer, primary_key=True,
+ test_needs_autoincrement=True)
+ name = Column('name', String(50))
+
+ class Address(Base, fixtures.ComparableEntity):
+ __tablename__ = 'addresses'
+
+ id = Column(Integer, primary_key=True,
+ test_needs_autoincrement=True)
+ email = Column(String(50), key='_email')
+ user_id = Column('user_id', Integer, ForeignKey('users.id'),
+ key='_user_id')
+ user = relationship(
+ User,
+ backref=backref("addresses",
+ order_by=util.u("Address.email")))
+
+ assert Address.user.property.mapper.class_ is User
+
def test_no_table(self):
def go():
class User(Base):