#NEWLINE# @ patch ( 'ramses.models.setup_data_model' ) #NEWLINE# @ patch ( 'ramses.models.get_existing_model' ) #NEWLINE# def test_prepare_relationship_resource_found( self , mock_get , mock_set ) : #NEWLINE# #INDENT# from ramses import models #NEWLINE# config = Mock ( ) #NEWLINE# matching_res = Mock ( method = 'post' , path = '/stories' ) #NEWLINE# resource = Mock ( root = Mock ( resources = [ matching_res , Mock ( method = 'options' , path = '/stories' ) , Mock ( method = 'post' , path = '/items' ) ] ) ) #NEWLINE# mock_get . return_value = None #NEWLINE# config = config_mock ( ) #NEWLINE# models . prepare_relationship ( config , 'Story' , resource ) #NEWLINE# mock_set . assert_called_once_with ( self , matching_res , 'Story' )