Add SAFE_MODE concept to let tests run without plugins (#753)

* Adds a `SAFE_MODE` config to disable the loading of plugins.
This commit is contained in:
Kevin Chung
2018-11-25 13:11:31 -05:00
committed by GitHub
parent 3b1872499a
commit 3e8f13dfd1
2 changed files with 3 additions and 1 deletions

View File

@@ -189,6 +189,7 @@ def create_app(config='CTFd.config.Config'):
app.register_error_handler(500, general_error) app.register_error_handler(500, general_error)
app.register_error_handler(502, gateway_error) app.register_error_handler(502, gateway_error)
init_plugins(app) if app.config.get('SAFE_MODE', False):
init_plugins(app)
return app return app

View File

@@ -210,3 +210,4 @@ class TestingConfig(Config):
UPDATE_CHECK = False UPDATE_CHECK = False
REDIS_URL = None REDIS_URL = None
CACHE_TYPE = 'simple' CACHE_TYPE = 'simple'
SAFE_MODE = True