diff options
| author | Jocelyn Delande <jocelyn@crapouillou.net> | 2015-08-18 19:06:24 +0200 |
|---|---|---|
| committer | Jocelyn Delande <jocelyn@crapouillou.net> | 2016-04-03 22:31:32 +0200 |
| commit | b685fa74d641ceeb077005698cc63108350f1d36 (patch) | |
| tree | 724d03e09ff6aa189dc6e67ca9be505b5fcfaea5 /budget/run.py | |
| parent | a8841f9d3f90ec4c1915493a1b34fa1798895772 (diff) | |
| download | ihatemoney-mirror-b685fa74d641ceeb077005698cc63108350f1d36.zip ihatemoney-mirror-b685fa74d641ceeb077005698cc63108350f1d36.tar.gz ihatemoney-mirror-b685fa74d641ceeb077005698cc63108350f1d36.tar.bz2 | |
Do not load user-overriden settings in unit tests.
Loading not versioned settings.py during tests make them less predictable.
That's inspired from django behaviour with DJANGO_SETTING_MODULE environment variable.
Diffstat (limited to 'budget/run.py')
| -rw-r--r-- | budget/run.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/budget/run.py b/budget/run.py index bdb8f46..1e5fe59 100644 --- a/budget/run.py +++ b/budget/run.py @@ -1,3 +1,4 @@ +import os import warnings from flask import Flask, g, request, session @@ -14,7 +15,8 @@ app = Flask(__name__) def configure(): """ A way to (re)configure the app, specially reset the settings """ - app.config.from_object("default_settings") + config_obj = os.environ.get('FLASK_SETTINGS_MODULE', 'merged_settings') + app.config.from_object(config_obj) app.wsgi_app = PrefixedWSGI(app) # Deprecations |
