From 062a0395aaf41e35ae0b290c18b578402c2fd4ad Mon Sep 17 00:00:00 2001
From: Benjamin Bertrand <benjamin.bertrand@esss.se>
Date: Mon, 21 Aug 2017 11:18:35 +0200
Subject: [PATCH] Add config arg to create_app

Allow to easily pass config for testing
---
 app/factory.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/factory.py b/app/factory.py
index 736229d..f64c3e0 100644
--- a/app/factory.py
+++ b/app/factory.py
@@ -36,11 +36,12 @@ def register_cli(app):
                 app.logger.debug(f'{instance} already exists')
 
 
-def create_app():
+def create_app(config=None):
     app = Flask(__name__)
 
     app.config.from_object(settings)
     app.config.from_envvar('LOCAL_SETTINGS', silent=True)
+    app.config.update(config or {})
 
     if not app.debug:
         import logging
-- 
GitLab