#NEWLINE# @ patch ( 'open_connect.groups.tasks.send_system_message' ) #NEWLINE# def test_add_user_to_group_with_notification( self , mock ) : #NEWLINE# #INDENT# 'Test adding to a group with a notification' #NEWLINE# group = mommy . make ( Group ) #NEWLINE# subject = 'This is a subject' #NEWLINE# message = 'This is a message' #NEWLINE# add_user_to_group . delay ( self . user . pk , group . pk , notification = ( subject , message ) ) #NEWLINE# self . assertIn ( group , self . user . groups_joined ) #NEWLINE# self . assertIn ( self . user , group . get_members ( ) ) #NEWLINE# mock . delay . assert_called_with ( self . user . pk , 'This is a subject' , 'This is a message' )