#NEWLINE# def test_collections_are_removed_from_index_when_deleted( self ) : #NEWLINE# #INDENT# 'Tests that deleted collections are removed from the search index.' #NEWLINE# self . save_new_default_collection ( self . COLLECTION_ID , self . owner_id ) #NEWLINE# def mock_delete_docs( doc_ids , index ) : #NEWLINE# #INDENT# self . assertEqual ( index , collection_services . SEARCH_INDEX_COLLECTIONS ) #NEWLINE# self . assertEqual ( doc_ids , [ self . COLLECTION_ID ] ) #NEWLINE# #UNINDENT# delete_docs_swap = self . swap ( search_services , 'delete_documents_from_index' , mock_delete_docs ) #NEWLINE# with delete_docs_swap : #NEWLINE# #INDENT# collection_services . delete_collection ( self . owner_id , self . COLLECTION_ID )