#NEWLINE# @ mock . patch ( 'pushmanager.core.xmppclient.XMPPQueue.enqueue_user_xmpp' ) #NEWLINE# @ mock . patch ( 'pushmanager.core.mail.MailQueue.enqueue_user_email' ) #NEWLINE# def test_mailqueue_on_db_complete( self , mailq , _ ) : #NEWLINE# #INDENT# self . call_on_db_complete ( ) #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 ] ) #NEWLINE# watched_call_args = mailq . call_args_list [ 1 ] [ 0 ] #NEWLINE# T . assert_equal ( [ 'testuser' , 'testuser1' , 'testuser2' ] , watched_call_args [ 0 ] ) #NEWLINE# T . assert_in ( 'request for testuser (testuser1,testuser2)' , watched_call_args [ 1 ] ) #NEWLINE# T . assert_in ( 'testuser (testuser1,testuser2) - title' , watched_call_args [ 1 ] ) #NEWLINE# T . assert_in ( '[push] testuser (testuser1,testuser2) - title' , mailq [ 2 ] )