Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 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
Ejemplo n.º 3
0
 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
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
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
Ejemplo n.º 6
0
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
Ejemplo n.º 7
0
 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
Ejemplo n.º 8
0
 def create_app(self):
     app = super(APITestCase, self).create_app()
     storages.init_app(app)
     app.register_blueprint(blueprint)
     return app
Ejemplo n.º 9
0
 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
Ejemplo n.º 10
0
 def create_app(self):
     app = super(APITestCase, self).create_app()
     storages.init_app(app)
     app.register_blueprint(blueprint)
     return app