#NEWLINE# def test_override_length_validator( self ) : #NEWLINE# #INDENT# class ModelTest ( self . base ) : #NEWLINE# #INDENT# __tablename__ = 'model_test' #NEWLINE# id = sa . Column ( sa . Integer , primary_key = True ) #NEWLINE# test_column = sa . Column ( sa . Unicode ( 255 ) , nullable = True ) #NEWLINE# #UNINDENT# def length( min = ( - 1 ) , max = ( - 1 ) ) : #NEWLINE# #INDENT# return Length ( min = min , max = max , message = 'Wrong length' ) #NEWLINE# #UNINDENT# class ModelTestForm ( ModelForm ) : #NEWLINE# #INDENT# class Meta ( ) : #NEWLINE# #INDENT# model = ModelTest #NEWLINE# length_validator = length #NEWLINE# #UNINDENT# #UNINDENT# form = ModelTestForm ( ) #NEWLINE# assert ( self . test_column . validators [ 1 ] . message == 'Wrong length' )