def sampledb(): with create_app(TESTING=True).app_context(): # See <https://docs.sqlalchemy.org/en/latest/dialects/sqlite.html#foreign-key-support>: db.session.execute("PRAGMA foreign_keys=ON") db.create_all() with (Path(__file__).with_name("data") / "sampledb01.jsonl").open() as fp: for line in fp: add_wheel_from_json(json.loads(line)) db.session.commit() yield
def tmpdb_inited(): with create_app().app_context(): db.create_all() # See <https://docs.sqlalchemy.org/en/latest/dialects/sqlite.html#foreign-key-support>: db.session.execute("PRAGMA foreign_keys=ON") yield
from wheelodex.app import create_app application = create_app()