#NEWLINE# def test_object_collections_set( self ) : #NEWLINE# #INDENT# ( Foo , Bar ) = self . _two_obj_fixture ( uselist = True ) #NEWLINE# hi = Bar ( name = 'hi' ) #NEWLINE# there = Bar ( name = 'there' ) #NEWLINE# old = Bar ( name = 'old' ) #NEWLINE# new = Bar ( name = 'new' ) #NEWLINE# f = Foo ( ) #NEWLINE# eq_ ( attributes . get_state_history ( attributes . instance_state ( f ) , 'someattr' ) , ( ( ) , [ ] , ( ) ) ) #NEWLINE# f . someattr = [ hi ] #NEWLINE# eq_ ( attributes . get_state_history ( attributes . instance_state ( f ) , 'someattr' ) , ( [ hi ] , [ ] , [ ] ) ) #NEWLINE# self . _commit_someattr ( f ) #NEWLINE# eq_ ( attributes . get_state_history ( attributes . instance_state ( f ) , 'someattr' ) , ( ( ) , [ hi ] , ( ) ) ) #NEWLINE# f . someattr = [ there ] #NEWLINE# eq_ ( attributes . get_state_history ( attributes . instance_state ( f ) , 'someattr' ) , ( [ there ] , [ ] , [ hi ] ) ) #NEWLINE# self . _commit_someattr ( f ) #NEWLINE# eq_ ( attributes . get_state_history ( attributes . instance_state ( f ) , 'someattr' ) , ( ( ) , [ there ] , ( ) ) ) #NEWLINE# f . someattr = [ hi ] #NEWLINE# eq_ ( attributes . get_state_history ( attributes . instance_state ( f ) , 'someattr' ) , ( [ hi ] , [ ] , [ there ] ) ) #NEWLINE# f . someattr = [ old , new ] #NEWLINE# eq_ ( attributes . get_state_history ( attributes . instance_state ( f ) , 'someattr' ) , ( [ old , new ] , [ ] , [ there ] ) ) #NEWLINE# f = Foo ( ) #NEWLINE# collection = attributes . init_collection ( f , 'someattr' ) #NEWLINE# collection . append_without_event ( new ) #NEWLINE# attributes . instance_state ( f ) . _commit_all ( attributes . instance_dict ( f ) ) #NEWLINE# eq_ ( attributes . get_state_history ( attributes . instance_state ( f ) , 'someattr' ) , ( ( ) , [ new ] , ( ) ) ) #NEWLINE# f . someattr = [ old ] #NEWLINE# eq_ ( attributes . get_state_history ( attributes . instance_state ( f ) , 'someattr' ) , ( [ old ] , [ ] , [ new ] ) ) #NEWLINE# self . _commit_someattr ( f ) #NEWLINE# eq_ ( attributes . get_state_history ( attributes . instance_state ( f ) , 'someattr' ) , ( ( ) , [ old ] , ( ) ) )