From 7db5fe32a87d372f002caca2ec8e90faa7cd9149 Mon Sep 17 00:00:00 2001 From: Matt Wright Date: Mon, 4 Mar 2013 14:57:29 -0500 Subject: [PATCH] Turn on testing flag for test app --- tests/test_app/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_app/__init__.py b/tests/test_app/__init__.py index 863db79..ebf550c 100644 --- a/tests/test_app/__init__.py +++ b/tests/test_app/__init__.py @@ -10,10 +10,12 @@ from werkzeug.local import LocalProxy ds = LocalProxy(lambda: current_app.extensions['security'].datastore) + def create_app(config): app = Flask(__name__) app.debug = True app.config['SECRET_KEY'] = 'secret' + app.config['TESTING'] = True for key, value in config.items(): app.config[key] = value @@ -113,11 +115,13 @@ def create_app(config): return app + def create_roles(): for role in ('admin', 'editor', 'author'): ds.create_role(name=role) ds.commit() + def create_users(count=None): users = [('matt@lp.com', 'password', ['admin'], True), ('joe@lp.com', 'password', ['editor'], True), @@ -132,10 +136,12 @@ def create_users(count=None): roles=u[2], active=u[3]) ds.commit() + def populate_data(user_count=None): create_roles() create_users(user_count) + def add_context_processors(s): @s.context_processor def for_all():