def populate(directory=None): """ Populate database with fixtures """ if directory is None: directory = current_app.config['FIXTURES_DIR'] with perform( name='dbutils populate', before='Loading fixtures from directory %s' % directory, fail='Error occured while loading fixtures', ): load_fixtures(directory)
def create_app(self): self.app = app_factory() with self.app.app_context(): db.create_all() load_fixtures(self.app.config["FIXTURES_DIR"]) return self.app
def create_app(self): self.app = app_factory() with self.app.app_context(): db.create_all() load_fixtures(self.app.config['FIXTURES_DIR']) return self.app