#NEWLINE# def test_override_number_range_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 . Integer , info = { #NEWLINE# #INDENT# 'min' : 3 , #NEWLINE# #UNINDENT# } , nullable = True ) #NEWLINE# #UNINDENT# def number_range( min = ( - 1 ) , max = ( - 1 ) ) : #NEWLINE# #INDENT# return NumberRange ( min = min , max = max , message = 'Wrong number range' ) #NEWLINE# #UNINDENT# class ModelTestForm ( ModelForm ) : #NEWLINE# #INDENT# class Meta ( ) : #NEWLINE# #INDENT# model = ModelTest #NEWLINE# number_range_validator = number_range #NEWLINE# #UNINDENT# #UNINDENT# form = ModelTestForm ( ) #NEWLINE# assert ( form . test_column . validators [ 1 ] . message == 'Wrong number range' )