From b685fa74d641ceeb077005698cc63108350f1d36 Mon Sep 17 00:00:00 2001 From: Jocelyn Delande Date: Tue, 18 Aug 2015 19:06:24 +0200 Subject: 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. --- budget/run.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'budget/run.py') 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 -- cgit v1.1