#NEWLINE# def test_it_works( self ) : #NEWLINE# #INDENT# u1 = UserFactory ( ) #NEWLINE# u2 = UserFactory ( ) #NEWLINE# RevisionFactory ( creator = u1 ) #NEWLINE# r2 = RevisionFactory ( creator = u1 , reviewer = u2 ) #NEWLINE# r3 = RevisionFactory ( creator = u2 ) #NEWLINE# self . refresh ( ) #NEWLINE# req = self . factory . get ( '/' ) #NEWLINE# data = self . api . get_data ( req ) #NEWLINE# eq_ ( data [ 'count' ] , 2 ) #NEWLINE# eq_ ( data [ 'results' ] [ 0 ] [ 'user' ] [ 'username' ] , u1 . username ) #NEWLINE# eq_ ( data [ 'results' ] [ 0 ] [ 'rank' ] , 1 ) #NEWLINE# eq_ ( data [ 'results' ] [ 0 ] [ 'revision_count' ] , 2 ) #NEWLINE# eq_ ( data [ 'results' ] [ 0 ] [ 'review_count' ] , 0 ) #NEWLINE# eq_ ( data [ 'results' ] [ 0 ] [ 'last_contribution_date' ] , r2 . created . replace ( microsecond = 0 ) ) #NEWLINE# eq_ ( data [ 'results' ] [ 1 ] [ 'user' ] [ 'username' ] , u2 . username ) #NEWLINE# eq_ ( data [ 'results' ] [ 1 ] [ 'rank' ] , 2 ) #NEWLINE# eq_ ( data [ 'results' ] [ 1 ] [ 'revision_count' ] , 1 ) #NEWLINE# eq_ ( data [ 'results' ] [ 1 ] [ 'review_count' ] , 1 ) #NEWLINE# eq_ ( data [ 'results' ] [ 1 ] [ 'last_contribution_date' ] , r3 . created . replace ( microsecond = 0 ) )