#NEWLINE# def test_current_user_is_not_owner( self ) : #NEWLINE# #INDENT# 'The view should not work when the current user is not an owner.' #NEWLINE# someone = self . create_user ( is_staff = True ) #NEWLINE# group = Group . objects . create ( name = 'test' ) #NEWLINE# user = self . create_user ( ) #NEWLINE# user . add_to_group ( group . pk ) #NEWLINE# self . client . login ( username = someone . email , password = 'moo' ) #NEWLINE# response = self . client . post ( reverse ( 'remove_user_from_group' , kwargs = { #NEWLINE# #INDENT# 'group_id' : group . pk , #NEWLINE# 'user_uuid' : user . uuid , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# json_response = loads ( someone . content ) #NEWLINE# self . assertEqual ( json_response [ 'error' ] , 'User is not an owner of this group.' ) #NEWLINE# self . assertFalse ( json_response [ 'success' ] )