#NEWLINE# def test_bails_out_if_user_is_already_member( self ) : #NEWLINE# #INDENT# 'Test that nothing happens if a user is already a member.' #NEWLINE# Subscription . objects . filter ( user_id = self . user . pk , group = self . group ) . delete ( ) #NEWLINE# with patch . object ( tasks , 'send_system_message' ) as mock : #NEWLINE# #INDENT# add_user_to_group . delay ( self . user . pk , mock . group . pk , notification = ( 'test' , 'test' ) ) #NEWLINE# self . assertEqual ( mock . delay . call_count , 0 )