#NEWLINE# def test_joined_inheritance( self ) : #NEWLINE# #INDENT# app = flask . Flask ( __name__ ) #NEWLINE# db = fsa . SQLAlchemy ( db ) #NEWLINE# class Base ( db . Model ) : #NEWLINE# #INDENT# id = db . Column ( db . Integer , primary_key = True ) #NEWLINE# type = db . Column ( db . Unicode ( 20 ) ) #NEWLINE# __mapper_args__ = { #NEWLINE# #INDENT# 'polymorphic_on' : type , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# class SubBase ( Base ) : #NEWLINE# #INDENT# id = db . Column ( db . Integer , db . ForeignKey ( 'base.id' ) , primary_key = True ) #NEWLINE# __mapper_args__ = { #NEWLINE# #INDENT# 'polymorphic_identity' : 'sub' , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# self . assertEqual ( Base . __tablename__ , 'base' ) #NEWLINE# self . assertEqual ( SubBase . __tablename__ , 'sub_base' ) #NEWLINE# db . create_all ( )