

def test_complex_sort():
    (app, db, admin) = setup()
    (M1, M2) = create_models(db)
    m1 = M1('b')
    db.session.add(m1)
    db.session.add(M2('c', model1=m1))
    m2 = M1('a')
    db.session.add(m2)
    db.session.add(M2('c', model1=m2))
    db.session.commit()
    view = CustomModelView(M2, db.session, column_list=['string_field', 'model1.test1'], column_sortable_list=['model1.test1'])
    view.add_view(view)
    client = app.test_client()
    rv = client.get('/admin/model2/?sort=1')
    eq_(rv.status_code, 200)

dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/tests/sqla/test_basic.py test_complex_sort/VarMisuse@129/168 `admin`->`view`