

def test_exclude_columns():
    (app, db, admin) = setup()
    (Model1, Model2) = create_models(db)
    view = CustomModelView(Model1, db.session, column_exclude_list=['test2', 'test4', 'enum_field', 'date_field', 'time_field', 'datetime_field'])
    admin.add_view(view)
    eq_(view._list_columns, [('test1', 'Test1'), ('test3', 'Test3'), ('bool_field', 'Bool Field')])
    client = app.test_client()
    rv = client.get('/admin/model1/')
    data = rv.data.decode('utf-8')
    ok_(('Test1' in data))
    ok_(('Test2' not in data))

dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/tests/sqla/test_basic.py test_exclude_columns/original