#NEWLINE# def test_all_users_by_score( self ) : #NEWLINE# #INDENT# user2 = UserProfile . objects . get ( email = 'regular@mozilla.com' ) #NEWLINE# amo . REVIEWED_LEVELS [ 0 ] [ 'points' ] = 180 #NEWLINE# self . _give_points ( ) #NEWLINE# self . _give_points ( status = amo . STATUS_LITE ) #NEWLINE# self . _give_points ( user = user2 , status = amo . STATUS_NOMINATED ) #NEWLINE# users = ReviewerScore . all_users_by_score ( ) #NEWLINE# assert ( len ( users ) == 2 ) #NEWLINE# assert ( users [ 0 ] [ 'total' ] == 180 ) #NEWLINE# assert ( users [ 0 ] [ 'user_id' ] == self . user . id ) #NEWLINE# assert ( users [ 0 ] [ 'level' ] == amo . REVIEWED_LEVELS [ 0 ] [ 'name' ] ) #NEWLINE# assert ( users [ 1 ] [ 'total' ] == 120 ) #NEWLINE# assert ( users [ 1 ] [ 'user_id' ] == user2 . id ) #NEWLINE# assert ( users [ 1 ] [ 'level' ] == '' )