def init_database(): """Initialize database push all design documents """ import asyncio loop = asyncio.get_event_loop() from aioweb.db import get_db db = get_db() # need to import model to get them registered in the metaclass registry loop.run_until_complete(db.sync_designs(db)) loop.run_until_complete(import_sr25_nutr_def(db))
def db(self): return self._db or get_db()
def setUp(self): super(CouchDBTestCase, self).setUp() self.db = get_db(self.config) self.loop.run_until_complete(self.db.sync_designs(force=True))