#NEWLINE# def test_unsubscribe( self ) : #NEWLINE# #INDENT# 'Correct response when unsubscribing from a group.' #NEWLINE# self . user1 . add_to_group ( self . group . pk ) #NEWLINE# request = self . request_factory . post ( '/' , { #NEWLINE# #INDENT# 'group_id' : self . group . pk , #NEWLINE# #UNINDENT# } ) #NEWLINE# request . user = self . user1 #NEWLINE# response = views . handle_group_subscription ( content , 'unsubscribe' ) #NEWLINE# content = loads ( response . content ) #NEWLINE# self . assertTrue ( content [ 'success' ] ) #NEWLINE# self . assertEqual ( content [ 'message' ] , ( 'Successfully unsubscribed from %s.' % self . group . group . name ) ) #NEWLINE# self . assertEqual ( content [ 'group_id' ] , self . group . pk )