#NEWLINE# def test_get_list_reverse_order( context ) : #NEWLINE# #INDENT# Item . objects . all ( ) . delete ( ) #NEWLINE# for x in range ( 30 ) : #NEWLINE# #INDENT# Item . objects . create ( name = 'my name is {}' . format ( _range ) , text = 'my text is {}' . format ( x ) , is_active = ( x % 2 ) , status = x ) #NEWLINE# #UNINDENT# response = client . get ( reverse ( 'item_list' ) , content_type = 'application/json' ) #NEWLINE# _range = range ( 30 ) #NEWLINE# _range . reverse ( ) #NEWLINE# _range = [ x for x in _range ] #NEWLINE# expected_response_content = { #NEWLINE# #INDENT# 'items' : [ { #NEWLINE# #INDENT# 'id' : x , #NEWLINE# 'text' : 'my text is {}' . format ( x ) , #NEWLINE# 'popularity' : ( x + int ( ( x % 2 ) ) ) , #NEWLINE# #UNINDENT# } for x in _range ] , #NEWLINE# #UNINDENT# } #NEWLINE# expect ( json . loads ( response . content ) ) . to . equal ( expected_response_content ) #NEWLINE# expect ( response . status_code ) . to . equal ( 200 )