#NEWLINE# def test_replace_entry( self ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# 'name' : 'Some event' , #NEWLINE# 'locations-0-name' : 'Some location' , #NEWLINE# 'locations-0-description' : 'Some description' , #NEWLINE# 'locations-0-type' : 'restaurant' , #NEWLINE# #UNINDENT# } #NEWLINE# event = self . save ( data = data ) #NEWLINE# location_id = event . locations [ 0 ] . id #NEWLINE# self . session . commit ( ) #NEWLINE# data = { #NEWLINE# #INDENT# 'name' : 'Some event' , #NEWLINE# 'locations-0-name' : 'Some other location' , #NEWLINE# #UNINDENT# } #NEWLINE# self . save ( event , event ) #NEWLINE# location = event . locations [ 0 ] #NEWLINE# assert ( location . id != location_id ) #NEWLINE# assert ( location . name == 'Some other location' ) #NEWLINE# assert ( location . description == '' ) #NEWLINE# assert ( location . type == '' ) #NEWLINE# assert ( len ( event . locations ) == 1 )