示例#1
0
def app():
    # load 'TestConfig' from config.py
    app = create_app(config_name='test')
    from api.extensions import db

    with app.app_context():
        db.create_all()
        yield app
        db.drop_all()
示例#2
0
def db(app):
    _db.app = app

    with app.app_context():
        _db.create_all()

    yield _db

    _db.session.close()
    _db.drop_all()
示例#3
0
def dropall():
    "Drops all database tables"
    if prompt_bool("Are you sure ? You will lose all your data !"):
        db.drop_all()
 def tearDownClass(self):
     with FLASKR.app_context():
         db.drop_all()
     pass
示例#5
0
def teardown_db():
    db.session.remove()
    db.drop_all()
    db.session.bind.dispose()
 def tearDown(self):
     db.session.remove()
     db.drop_all()