diff options
Diffstat (limited to 'test/ext/declarative/test_inheritance.py')
-rw-r--r-- | test/ext/declarative/test_inheritance.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/ext/declarative/test_inheritance.py b/test/ext/declarative/test_inheritance.py index 3e6980190..274a6aa28 100644 --- a/test/ext/declarative/test_inheritance.py +++ b/test/ext/declarative/test_inheritance.py @@ -1453,3 +1453,33 @@ class ConcreteExtensionConfigTest( "FROM actual_documents) AS pjoin" ) + def test_column_attr_names(self): + """test #3480""" + + class Document(Base, AbstractConcreteBase): + documentType = Column('documenttype', String) + + class Offer(Document): + __tablename__ = 'offers' + + id = Column(Integer, primary_key=True) + __mapper_args__ = { + 'polymorphic_identity': 'offer' + } + + configure_mappers() + session = Session() + self.assert_compile( + session.query(Document), + "SELECT pjoin.documenttype AS pjoin_documenttype, " + "pjoin.id AS pjoin_id, pjoin.type AS pjoin_type FROM " + "(SELECT offers.documenttype AS documenttype, offers.id AS id, " + "'offer' AS type FROM offers) AS pjoin" + ) + + self.assert_compile( + session.query(Document.documentType), + "SELECT pjoin.documenttype AS pjoin_documenttype FROM " + "(SELECT offers.documenttype AS documenttype, offers.id AS id, " + "'offer' AS type FROM offers) AS pjoin" + ) |