diff --git a/{{cookiecutter.app_name}}/tests/conftest.py b/{{cookiecutter.app_name}}/tests/conftest.py index 2d3240b..42774cc 100644 --- a/{{cookiecutter.app_name}}/tests/conftest.py +++ b/{{cookiecutter.app_name}}/tests/conftest.py @@ -10,7 +10,7 @@ from {{cookiecutter.app_name}}.app import create_app from {{cookiecutter.app_name}}.database import db as _db -@pytest.yield_fixture(scope='session') +@pytest.yield_fixture(scope='function') def app(): _app = create_app(TestConfig) ctx = _app.test_request_context() diff --git a/{{cookiecutter.app_name}}/tests/test_webtests.py b/{{cookiecutter.app_name}}/tests/test_webtests.py index 1c99da1..e0368c7 100644 --- a/{{cookiecutter.app_name}}/tests/test_webtests.py +++ b/{{cookiecutter.app_name}}/tests/test_webtests.py @@ -24,7 +24,7 @@ class TestLoggingIn: form['username'] = user.username form['password'] = 'myprecious' # Submits - res = form.submit() + res = form.submit().follow() assert res.status_code == 200 def test_sees_alert_on_log_out(self, user, testapp): @@ -34,7 +34,7 @@ class TestLoggingIn: form['username'] = user.username form['password'] = 'myprecious' # Submits - res = form.submit() + res = form.submit().follow() res = testapp.get(url_for('public.logout')).follow() # sees alert assert 'You are logged out.' in res diff --git a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/settings.py b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/settings.py index 50a3bc3d..03efe74 100644 --- a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/settings.py +++ b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/settings.py @@ -3,10 +3,11 @@ import os class Config(object): - SECRET_KEY = 'shhhh' + SECRET_KEY = 'shhhh' # TODO: Change me APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir)) BCRYPT_LOG_ROUNDS = 13 + ASSETS_DEBUG = False DEBUG_TB_ENABLED = False # Disable Debug toolbar DEBUG_TB_INTERCEPT_REDIRECTS = False CACHE_TYPE = 'simple' # Can be "memcached", "redis", etc. @@ -16,7 +17,7 @@ class ProdConfig(Config): """Production configuration.""" ENV = 'prod' DEBUG = False - SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/example' + SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/example' # TODO: Change me DEBUG_TB_ENABLED = False # Disable Debug toolbar