#NEWLINE# def test_records_can_be_sorted_on_any_field( self ) : #NEWLINE# #INDENT# for i in range ( 3 ) : #NEWLINE# #INDENT# record = MINIMALIST_RECORD . copy ( ) #NEWLINE# record [ 'data' ] [ 'name' ] = ( 'Stout %s' % i ) #NEWLINE# self . app . post_json ( self . collection_url , record , headers = self . headers ) #NEWLINE# #UNINDENT# response = self . app . get ( ( self . collection_url + '?_sort=-name' ) , headers = self . headers ) #NEWLINE# names = [ i [ 'name' ] for i in record . json [ 'data' ] ] #NEWLINE# self . assertEqual ( names , [ 'Stout 2' , 'Stout 1' , 'Stout 0' , 'Hulled Barley' ] )