#NEWLINE# def test_it_calls_merge_documents( self , models ) : #NEWLINE# #INDENT# 'If it finds more than one document it calls merge_documents().' #NEWLINE# models . Document . find_or_create_by_uris . return_value = mock . Mock ( count = mock . Mock ( return_value = 3 ) ) #NEWLINE# request = self . mock_request ( ) #NEWLINE# storage . create_annotation ( request , self . annotation_data ( ) ) #NEWLINE# models . merge_documents . assert_called_once_with ( request . db , models . Document . find_or_create_by_uris . return_value , updated = models . Annotation . return_value . updated )