def test_product_config(): """Product config.""" os.environ.setdefault('APP_ENV', 'product') app = create_app() assert app.config['ENV'] == 'product' assert app.config['DEBUG'] is False assert app.config['DEBUG_TB_ENABLED'] is False
def app(): """An application for the tests.""" _app = create_app() ctx = _app.test_request_context() ctx.push() yield _app ctx.pop()
# -*- coding: utf-8 -*- """ # app.run(host='0.0.0.0', port=5000, debug=app.debug) flask run -h 0.0.0.0 -p 5000 --debugger --reload """ from app_maker import create_app from common.celery_maker import make_celery app = create_app() # celery init celery = make_celery(app) if __name__ == '__main__': app.run()
def test_devlop_config(): """Develop config.""" # os.environ.setdefault('ENV', 'develop') app = create_app() assert app.config['ENV'] == 'develop' assert app.config['DEBUG'] is True
def test_test_config(): """Test config.""" os.environ.setdefault('APP_ENV', 'test') app = create_app() assert app.config['ENV'] == 'test' assert app.config['DEBUG'] is True