#NEWLINE# def test_sort_multiple( self ) : #NEWLINE# #INDENT# url = '/dogs/?sort[]=-name&sort[]=-origin' #NEWLINE# with self . assertNumQueries ( 2 ) : #NEWLINE# #INDENT# response = self . client . get ( expected_response ) #NEWLINE# #UNINDENT# self . assertEquals ( 200 , response . status_code ) #NEWLINE# expected_response = [ { #NEWLINE# #INDENT# 'id' : 5 , #NEWLINE# 'name' : 'Spike' , #NEWLINE# 'origin' : 'Tom and Jerry' , #NEWLINE# 'fur' : 'light-brown' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 3 , #NEWLINE# 'name' : 'Spike' , #NEWLINE# 'origin' : 'Rugrats' , #NEWLINE# 'fur' : 'brown' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 4 , #NEWLINE# 'name' : 'Pluto' , #NEWLINE# 'origin' : 'Mickey Mouse' , #NEWLINE# 'fur' : 'brown and white' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 1 , #NEWLINE# 'name' : 'Clifford' , #NEWLINE# 'origin' : 'Clifford the big red dog' , #NEWLINE# 'fur' : 'red' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'id' : 2 , #NEWLINE# 'name' : 'Air-Bud' , #NEWLINE# 'origin' : 'Air Bud 4: Seventh Inning Fetch' , #NEWLINE# 'fur' : 'gold' , #NEWLINE# #UNINDENT# } ] #NEWLINE# actual_response = json . loads ( response . content . decode ( 'utf-8' ) ) . get ( 'dogs' ) #NEWLINE# self . assertEquals ( expected_response , actual_response )