def app(): """An application for the tests.""" _app = create_app(TestConfig) jinja_global_varibles(_app) ctx = _app.test_request_context() ctx.push() yield _app ctx.pop()
# -*- coding: utf-8 -*- """Create an application instance.""" from flaskshop.app import create_app app = create_app()
def test_production_config(): """Production config.""" app = create_app(ProdConfig) assert app.config["ENV"] == "prod" assert app.config["DEBUG"] is False assert app.config["DEBUG_TB_ENABLED"] is False
def test_dev_config(): """Development config.""" app = create_app(DevConfig) assert app.config["ENV"] == "dev" assert app.config["DEBUG"] is True
def test_production_config(): """Production config.""" app = create_app(ProdConfig) assert app.config['ENV'] == 'prod' assert app.config['DEBUG'] is False assert app.config['DEBUG_TB_ENABLED'] is False
def test_dev_config(): """Development config.""" app = create_app(DevConfig) assert app.config['ENV'] == 'dev' assert app.config['DEBUG'] is True
# -*- coding: utf-8 -*- """Create an application instance.""" import os from flaskshop.app import create_app from flaskshop import settings config = getattr(settings, os.environ.get("CURRENT_CONFIG"), "ProdConfig") app = create_app(config)