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()}