コード例 #1
0
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
コード例 #2
0
ファイル: test_cli.py プロジェクト: pombredanne/wheelodex
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
コード例 #3
0
from wheelodex.app import create_app

application = create_app()