示例#1
0
def drop_database():
    _app = create_app(env_name='TEST')
    ctx = _app.app_context()
    ctx.push()

    from middleman import db

    db.drop_all()
示例#2
0
def app(drop_database, request):
    _app = create_app(env_name='TEST')

    ctx = _app.app_context()
    ctx.push()

    from middleman import db

    db.drop_all()
    db.create_all()

    request.addfinalizer(lambda: ctx.pop())

    return _app