#NEWLINE# @ mock . patch ( 'website.project.model.Node.update_search' ) #NEWLINE# @ mock . patch ( 'website.mails.send_mail' ) #NEWLINE# @ mock . patch ( 'website.archiver.tasks.archive_success.delay' ) #NEWLINE# def test_archiving_nodes_added_to_search_on_archive_success_if_public( self , mock_update_search , mock_send , mock_archive_success ) : #NEWLINE# #INDENT# proj = factories . ProjectFactory ( ) #NEWLINE# reg = factories . RegistrationFactory ( project = proj ) #NEWLINE# reg . save ( ) #NEWLINE# with nested ( mock . patch ( 'website.archiver.model.ArchiveJob.archive_tree_finished' , mock . Mock ( return_value = True ) ) , mock . patch ( 'website.archiver.model.ArchiveJob.sent' , mock . PropertyMock ( return_value = False ) ) , mock . patch ( 'website.archiver.model.ArchiveJob.success' , mock . PropertyMock ( return_value = True ) ) ) as ( mock_finished , mock_sent , mock_success ) : #NEWLINE# #INDENT# listeners . archive_callback ( reg ) #NEWLINE# #UNINDENT# assert_equal ( reg . call_count , 1 )