#NEWLINE# def test_get_with_include( self ) : #NEWLINE# #INDENT# with self . assertNumQueries ( 2 ) : #NEWLINE# #INDENT# response = self . client . get ( '/users/?include[]=groups' ) #NEWLINE# #UNINDENT# self . assertEquals ( 200 , response . status_code ) #NEWLINE# self . assertEquals ( { #NEWLINE# #INDENT# 'users' : [ { #NEWLINE# #INDENT# 'id' : 1 , #NEWLINE# 'groups' : [ 1 , 2 ] , #NEWLINE# 'location' : 1 , #NEWLINE# 'name' : '0' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 2 , #NEWLINE# 'groups' : [ 1 , 2 ] , #NEWLINE# 'location' : 1 , #NEWLINE# 'name' : '1' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 3 , #NEWLINE# 'groups' : [ 1 , 2 ] , #NEWLINE# 'location' : 2 , #NEWLINE# 'name' : '2' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 4 , #NEWLINE# 'groups' : [ 1 , 2 ] , #NEWLINE# 'location' : 3 , #NEWLINE# 'name' : '3' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , json . loads ( response . content . decode ( 'utf-8' ) ) ) #NEWLINE# with self . assertNumQueries ( 2 ) : #NEWLINE# #INDENT# response = self . client . get ( '/groups/?include[]=members' ) #NEWLINE# #UNINDENT# self . assertEquals ( 200 , response . status_code ) #NEWLINE# self . assertEquals ( { #NEWLINE# #INDENT# 'groups' : [ { #NEWLINE# #INDENT# 'id' : 1 , #NEWLINE# 'members' : [ 1 , 2 , 3 , 4 ] , #NEWLINE# 'name' : '0' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 2 , #NEWLINE# 'members' : [ 1 , 2 , 3 , 4 ] , #NEWLINE# 'name' : '1' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , json . loads ( response . content . decode ( 'utf-8' ) ) )