#NEWLINE# def test_scoped_session_no_save_on_init( self ) : #NEWLINE# #INDENT# metadata . bind = 'sqlite://' #NEWLINE# class Person ( Entity ) : #NEWLINE# #INDENT# using_mapper_options ( save_on_init = False ) #NEWLINE# name = Field ( String ( 30 ) ) #NEWLINE# #UNINDENT# setup_all ( True ) #NEWLINE# homer = Person ( name = 'Homer' ) #NEWLINE# bart = Person ( name = 'Bart' ) #NEWLINE# assert ( homer not in session ) #NEWLINE# assert ( bart not in session ) #NEWLINE# session . add ( homer ) #NEWLINE# session . add ( homer ) #NEWLINE# session . commit ( ) #NEWLINE# assert ( Person . query . filter_by ( name = 'Homer' ) . one ( ) is homer )