예제 #1
0
def app():
    app = create_app('test')
    app.config.from_object(TestingConfig)
    with app.app_context():
        db.create_all()
        yield app
        db.drop_all()
예제 #2
0
from url_shortener import create_app
from url_shortener.extensions import db

print("Creating tables")

db.create_all(app=create_app())
예제 #3
0
 def setUp(self):
     self.app = create_app(config_file='tests/test_settings.py').test_client()
     db.create_all(app=create_app(config_file='tests/test_settings.py'))