def test_extra_fields():
    (app, db, admin) = setup()
    (Model1, _) = create_models(db)
    view = CustomModelView(Model1, form_extra_fields={'extra_field': fields.StringField('Extra Field')})
    admin.add_view(view)
    client = app.test_client()
    rv = client.get('/admin/model1/new/')
    eq_(rv.status_code, 200)
    data = rv.data.decode('utf-8')
    ok_(('Extra Field' in data))
    pos1 = data.find('Extra Field')
    pos2 = data.find('Test1')
    ok_((pos2 < pos1))
def test_extra_fields():
    (app, db, admin) = setup()
    (Model1, _) = create_models(db)
    view = CustomModelView(Model1, form_extra_fields={'extra_field': fields.StringField('Extra Field')})
    admin.add_view(view)
    client = app.test_client()
    rv = client.get('/admin/model1/new/')
    eq_(rv.status_code, 200)
    data = rv.data.decode('utf-8')
    ok_(('Extra Field' in data))
    pos1 = data.find('Extra Field')
    pos2 = data.find('Test1')
    ok_((pos2 < pos1))