#NEWLINE# @ mock . patch ( 'pushmanager.core.mail.MailQueue.enqueue_user_email' ) #NEWLINE# def test_no_watched_mailqueue_on_db_complete( self , mailq ) : #NEWLINE# #INDENT# req = { #NEWLINE# #INDENT# 'user' : 'testuser' , #NEWLINE# 'watchers' : None , #NEWLINE# 'repo' : 'repo' , #NEWLINE# 'branch' : 'branch' , #NEWLINE# 'title' : 'title' , #NEWLINE# 'state' : 'discarded' , #NEWLINE# #UNINDENT# } #NEWLINE# self . call_on_db_complete ( self ) #NEWLINE# no_watcher_call_args = mailq . call_args_list [ 0 ] [ 0 ] #NEWLINE# T . assert_equal ( [ 'testuser' ] , no_watcher_call_args [ 0 ] ) #NEWLINE# T . assert_in ( 'Request for testuser' , no_watcher_call_args [ 1 ] ) #NEWLINE# T . assert_in ( 'testuser - title' , no_watcher_call_args [ 1 ] ) #NEWLINE# T . assert_in ( '[push] testuser - title' , no_watcher_call_args [ 2 ] )