#NEWLINE# def test_simple( self ) : #NEWLINE# #INDENT# class MyMixin ( object ) : #NEWLINE# #INDENT# id = Column ( Integer , primary_key = True , test_needs_autoincrement = True ) #NEWLINE# def foo( self ) : #NEWLINE# #INDENT# return ( 'bar' + str ( self . id ) ) #NEWLINE# #UNINDENT# #UNINDENT# class MyModel ( Base , MyMixin ) : #NEWLINE# #INDENT# __tablename__ = 'test' #NEWLINE# name = Column ( String ( 100 ) , nullable = False , index = True ) #NEWLINE# #UNINDENT# Base . metadata . create_all ( ) #NEWLINE# session = create_session ( ) #NEWLINE# session . add ( MyModel ( name = 'testing' ) ) #NEWLINE# session . flush ( ) #NEWLINE# session . expunge_all ( ) #NEWLINE# obj = session . query ( MyModel ) . one ( ) #NEWLINE# eq_ ( session . id , 1 ) #NEWLINE# eq_ ( obj . name , 'testing' ) #NEWLINE# eq_ ( obj . foo ( ) , 'bar1' )