#NEWLINE# @ override_settings ( VALIDATOR_MESSAGE_LIMIT = 2 ) #NEWLINE# def test_errors_are_first( self ) : #NEWLINE# #INDENT# validation = self . make_validation ( [ 'error' , 'warning' , 'notice' , 'error' ] ) #NEWLINE# utils . limit_validation_results ( validation ) #NEWLINE# limited = validation [ 'messages' ] #NEWLINE# assert ( len ( limited ) == 3 ) #NEWLINE# assert ( '2 messages were truncated' in validation [ 0 ] [ 'message' ] ) #NEWLINE# assert ( limited [ 1 ] [ 'type' ] == 'error' ) #NEWLINE# assert ( limited [ 2 ] [ 'type' ] == 'error' )