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

    class Model(db.Document):
        name = db.StringField(max_length=20, choices=('a', 'b', 'c'))
    view = CustomModelView(Model)
    admin.add_view(view)
    form = view.create_form()
    eq_(form.name.choices, [('a', 'a'), ('b', 'b'), ('c', 'c')])
def test_form_flat_choices():
    (app, db, admin) = setup()

    class Model(db.Document):
        name = db.StringField(max_length=20, choices=('a', 'b', 'c'))
    view = CustomModelView(Model)
    admin.add_view(view)
    form = view.create_form()
    eq_(form.name.choices, [('a', 'a'), ('b', 'b'), ('c', 'c')])