aboutsummaryrefslogtreecommitdiff
path: root/bootstrap.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-05-15 07:24:18 +0200
committerCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-05-15 07:24:18 +0200
commitdd059ad8a7d94ea6d03639e10e4d41c95dd1cebd (patch)
tree8aa3c0bf481a67717987af0710540668d3467ab0 /bootstrap.py
parentThe list of inactive feeds is now sorted. (diff)
parenttesting special controller methods (diff)
downloadnewspipe-dd059ad8a7d94ea6d03639e10e4d41c95dd1cebd.tar.gz
newspipe-dd059ad8a7d94ea6d03639e10e4d41c95dd1cebd.tar.bz2
newspipe-dd059ad8a7d94ea6d03639e10e4d41c95dd1cebd.zip
Merged in jaesivsm/pyaggr3g470r (pull request #13)
introducing unittests !
Diffstat (limited to 'bootstrap.py')
-rw-r--r--bootstrap.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/bootstrap.py b/bootstrap.py
index 7a5a9b6e..9cab7417 100644
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -22,7 +22,15 @@ from flask.ext.sqlalchemy import SQLAlchemy
# Create Flask application
application = Flask('pyaggr3g470r')
-application.debug = conf.LOG_LEVEL <= logging.DEBUG
+if os.environ.get('PYAGG_TESTING', False) == 'true':
+ application.debug = logging.DEBUG
+ application.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:'
+ application.config['TESTING'] = True
+else:
+ application.debug = conf.LOG_LEVEL <= logging.DEBUG
+ application.config['SQLALCHEMY_DATABASE_URI'] \
+ = conf.SQLALCHEMY_DATABASE_URI
+
scheme, domain, _, _, _ = urlsplit(conf.PLATFORM_URL)
application.config['SERVER_NAME'] = domain
application.config['PREFERRED_URL_SCHEME'] = scheme
@@ -33,7 +41,6 @@ set_logging(conf.LOG_PATH, log_level=conf.LOG_LEVEL)
application.config['SECRET_KEY'] = getattr(conf, 'WEBSERVER_SECRET', None)
if not application.config['SECRET_KEY']:
application.config['SECRET_KEY'] = os.urandom(12)
-application.config['SQLALCHEMY_DATABASE_URI'] = conf.SQLALCHEMY_DATABASE_URI
application.config['RECAPTCHA_USE_SSL'] = True
application.config['RECAPTCHA_PUBLIC_KEY'] = conf.RECAPTCHA_PUBLIC_KEY
bgstack15