def app(): app = create_app('test') app.config.from_object(TestingConfig) with app.app_context(): db.create_all() yield app db.drop_all()
from url_shortener import create_app from url_shortener.extensions import db print("Creating tables") db.create_all(app=create_app())
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'))