#NEWLINE# @ mock . patch ( 'website.mails.send_mail' ) #NEWLINE# @ mock . patch ( 'website.archiver.tasks.archive_success.delay' ) #NEWLINE# def test_archive_callback_done_success( self , mock_send , mock_archive_success ) : #NEWLINE# #INDENT# for addon in [ 'osfstorage' , 'dropbox' ] : #NEWLINE# #INDENT# self . dst . archive_job . update_target ( addon , ARCHIVER_SUCCESS ) #NEWLINE# #UNINDENT# self . dst . archive_job . save ( ) #NEWLINE# listeners . archive_callback ( self . dst ) #NEWLINE# assert_equal ( mock_send . call_count , 1 )