#NEWLINE# def test_ordering( self ) : #NEWLINE# #INDENT# a1 = AnswerFactory ( ) #NEWLINE# a2 = AnswerFactory ( ) #NEWLINE# res = self . client . get ( reverse ( 'answer-list' ) ) #NEWLINE# eq_ ( res . data [ 'results' ] [ 0 ] [ 'id' ] , a2 . id ) #NEWLINE# eq_ ( res . data [ 'results' ] [ 1 ] [ 'id' ] , a1 . id ) #NEWLINE# res = self . client . get ( ( reverse ( 'answer-list' ) + '?ordering=id' ) ) #NEWLINE# eq_ ( res . data [ 'results' ] [ 0 ] [ 'id' ] , a1 . id ) #NEWLINE# eq_ ( res . data [ 'results' ] [ 1 ] [ 'id' ] , self . id ) #NEWLINE# res = self . client . get ( ( reverse ( 'answer-list' ) + '?ordering=-id' ) ) #NEWLINE# eq_ ( res . data [ 'results' ] [ 0 ] [ 'id' ] , a2 . id ) #NEWLINE# eq_ ( res . data [ 'results' ] [ 1 ] [ 'id' ] , a1 . id )