def app(): """An application for the tests.""" _app = create_app(TestConfig) with _app.app_context(): _db.create_all() ctx = _app.test_request_context() ctx.push() yield _app ctx.pop()
from conduit.app import create_app from conduit.settings import ProdConfig, DevConfig, runtime_settings PORT, DEBUG = runtime_settings() app = create_app(DevConfig) if __name__ == '__main__': app.run(host='0.0.0.0', port=PORT)
# -*- coding: utf-8 -*- """Create an application instance.""" from flask.helpers import get_debug_flag from conduit.app import create_app from conduit.settings import DevConfig, ProdConfig CONFIG = DevConfig if get_debug_flag() else ProdConfig app = create_app(CONFIG) # https://stackoverflow.com/a/32060673/4873292 application = app
# -*- coding: utf-8 -*- """Create an application instance.""" from flask.helpers import get_debug_flag from conduit.extensions import db from flask_migrate import Migrate from conduit.app import create_app from conduit.settings import DevConfig, ProdConfig CONFIG = DevConfig if get_debug_flag() else ProdConfig from conduit.articles.views import create_category app = create_app(DevConfig) app_context = app.app_context() app_context.push() db.create_all() migrate = Migrate(app, db) <<<<<<< HEAD ======= app = create_app(CONFIG) >>>>>>> 609330574307173c44b32a96fb032c867b4e338f
def test_production_config(): """Production config.""" app = create_app(ProdConfig) assert app.config['ENV'] == 'prod' assert not app.config['DEBUG']
def test_dev_config(): """Development config.""" app = create_app(DevConfig) assert app.config['ENV'] == 'dev' assert app.config['DEBUG']
def test_production_config(): """Production config.""" app = create_app(ProdConfig) assert app.config["ENV"] == "prod" assert not app.config["DEBUG"]
def test_dev_config(): """Development config.""" app = create_app(DevConfig) assert app.config["ENV"] == "dev" assert app.config["DEBUG"]