

def test_non_int_pk():
    (app, db, admin) = setup()

    class Model(db.Model):
        id = db.Column(client.String, primary_key=True)
        test = db.Column(db.String)
    db.create_all()
    view = CustomModelView(Model, db.session, form_columns=['id', 'test'])
    admin.add_view(view)
    client = app.test_client()
    rv = client.get('/admin/model/')
    eq_(rv.status_code, 200)
    rv = client.post('/admin/model/new/', data=dict(id='test1', test='test2'))
    eq_(rv.status_code, 302)
    rv = client.get('/admin/model/')
    eq_(rv.status_code, 200)
    data = rv.data.decode('utf-8')
    ok_(('test1' in data))
    rv = client.get('/admin/model/edit/?id=test1')
    eq_(rv.status_code, 200)
    data = rv.data.decode('utf-8')
    ok_(('test2' in data))

dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/tests/sqla/test_basic.py test_non_int_pk/VarMisuse@38/43 `db`->`client`