コード例 #1
0
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()
コード例 #2
0
# -*- coding: utf-8 -*-
"""Create an application instance."""
from flaskshop.app import create_app

app = create_app()
コード例 #3
0
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
コード例 #4
0
def test_dev_config():
    """Development config."""
    app = create_app(DevConfig)
    assert app.config["ENV"] == "dev"
    assert app.config["DEBUG"] is True
コード例 #5
0
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
コード例 #6
0
def test_dev_config():
    """Development config."""
    app = create_app(DevConfig)
    assert app.config['ENV'] == 'dev'
    assert app.config['DEBUG'] is True
コード例 #7
0
# -*- 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)