#NEWLINE# def test_find_or_new_finds_model( self ) : #NEWLINE# #INDENT# relation = self . _get_relation ( ) #NEWLINE# model = flexmock ( ) #NEWLINE# model . foo = 'bar' #NEWLINE# relation . get_query ( ) . should_receive ( 'find' ) . once ( ) . with_args ( 'foo' , [ '*' ] ) . and_return ( self ) #NEWLINE# model . should_receive ( 'set_attribute' ) . never ( ) #NEWLINE# self . assertEqual ( 'bar' , relation . find_or_new ( 'foo' ) . foo )