#NEWLINE# def test_form_override( ) : #NEWLINE# #INDENT# ( app , db , admin ) = setup ( ) #NEWLINE# class Model ( db . Model ) : #NEWLINE# #INDENT# id = db . Column ( db . String , primary_key = True ) #NEWLINE# test = db . Column ( db . String ) #NEWLINE# #UNINDENT# db . create_all ( ) #NEWLINE# view1 = CustomModelView ( Model , db . session , endpoint = 'view1' ) #NEWLINE# view2 = CustomModelView ( Model , db . session , endpoint = 'view2' , form_overrides = dict ( test = fields . FileField ) ) #NEWLINE# admin . add_view ( view1 ) #NEWLINE# admin . add_view ( view2 ) #NEWLINE# eq_ ( view1 . _create_form_class . test . field_class , fields . StringField ) #NEWLINE# eq_ ( view2 . _create_form_class . test . field_class , fields . FileField )