コード例 #1
0
def test_communities(app, tmp_location):
    """Load test communities."""
    from b2share_demo.helpers import load_demo_data

    with app.app_context():
        tmp_location.default = True
        db.session.merge(tmp_location)
        db.session.commit()
        # load root schemas
        load_root_schemas()
        # load the demo
        load_demo_data(os.path.join(
            os.path.dirname(os.path.realpath(__file__)),
            'data'), verbose=0)
        db.session.commit()
        return {com.name: com.id for com in Community.query.all()}
コード例 #2
0
ファイル: conftest.py プロジェクト: EUDAT-B2SHARE/b2share
def test_communities(app, tmp_location):
    """Load test communities."""
    from b2share_demo.helpers import load_demo_data

    with app.app_context():
        tmp_location.default = True
        db.session.merge(tmp_location)
        db.session.commit()
        # load root schemas
        load_root_schemas()
        # load the demo
        load_demo_data(os.path.join(
            os.path.dirname(os.path.realpath(__file__)),
            'data'), verbose=0)
        db.session.commit()
        return {com.name: com.id for com in Community.query.all()}
コード例 #3
0
ファイル: common.py プロジェクト: emanueldima/b2share
def schemas_init(alembic, verbose):
    """Load root schemas."""
    load_root_schemas(cli=True, verbose=verbose)
コード例 #4
0
def schemas_init(alembic, verbose):
    """Load root schemas."""
    load_root_schemas(cli=True, verbose=verbose)