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

    Model1, _ = create_models(db)
    db.create_all()

    view = CustomModelView(Model1, db.session,
                           create_template='macro.html',
                           form_create_rules=(rules.Container('wrap', rules.Macro('test_lib.another_test')),))
    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')
    pos1 = data.find('<wrapper>')
    pos2 = data.find('another_test')
    pos3 = data.find('</wrapper>')
    ok_(pos1 != -1)
    ok_(pos2 != -1)
    ok_(pos3 != -1)
    ok_(pos1 < pos3 < pos2)
dataset/ETHPy150Open mrjoes/flask-admin/flask_admin/tests/sqla/test_form_rules.py/test_rule_container/swapped operands of `<`