def create_app(self): app = super(StorageTestMixin, self).create_app() self._instance_path = app.instance_path app.instance_path = mkdtemp() storages.init_app(app) app.register_blueprint(blueprint) return app
def create_app(self): app = super(APITestCase, self).create_app() storages.init_app(app) app.register_blueprint(blueprint) try: app.register_blueprint(admin) except AssertionError: pass return app
def instance_path(app, tmpdir): '''Use temporary application instance_path''' from udata.core import storages from udata.core.storages.views import blueprint app.instance_path = str(tmpdir) storages.init_app(app) app.register_blueprint(blueprint) return tmpdir
def instance_path(app, tmpdir): '''Use temporary application instance_path''' from udata.core import storages from udata.core.storages.views import blueprint app.instance_path = str(tmpdir) app.config['FS_ROOT'] = str(tmpdir / 'fs') # Force local storage: for s in 'resources', 'avatars', 'logos', 'images', 'chunks', 'tmp': key = '{0}_FS_{{0}}'.format(s.upper()) app.config[key.format('BACKEND')] = 'local' app.config.pop(key.format('ROOT'), None) storages.init_app(app) app.register_blueprint(blueprint) return tmpdir
def create_app(self, mock_backend): app = super(ResourcesTest, self).create_app() app.config['FS_BACKEND'] = MOCK_BACKEND storages.init_app(app) self.backend = mock_backend.return_value return app
def create_app(self): app = super(APITestCase, self).create_app() storages.init_app(app) app.register_blueprint(blueprint) return app