#NEWLINE# def test_with_query( self ) : #NEWLINE# #INDENT# 'Query should filter the list of members.' #NEWLINE# member1 = self . create_user ( first_name = 'Doctor Pepper' ) #NEWLINE# member2 = self . create_user ( ) #NEWLINE# group = mommy . make ( 'groups.Group' ) #NEWLINE# member1 . add_to_group ( group . pk ) #NEWLINE# member2 . add_to_group ( group . pk ) #NEWLINE# user = self . create_user ( ) #NEWLINE# self . client . login ( username = user . email , password = 'moo' ) #NEWLINE# response = self . client . get ( reverse ( 'group_members' , kwargs = { #NEWLINE# #INDENT# 'pk' : group . pk , #NEWLINE# #UNINDENT# } ) , { #NEWLINE# #INDENT# 'q' : 'Doctor' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertIn ( member1 , response . context [ 'group_members' ] ) #NEWLINE# self . assertNotIn ( user , response . context [ 'group_members' ] )