예제 #1
0
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()
예제 #2
0
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)
예제 #3
0
# -*- 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
예제 #5
0
파일: test_config.py 프로젝트: rahulwa/ji
def test_production_config():
    """Production config."""
    app = create_app(ProdConfig)
    assert app.config['ENV'] == 'prod'
    assert not app.config['DEBUG']
예제 #6
0
파일: test_config.py 프로젝트: rahulwa/ji
def test_dev_config():
    """Development config."""
    app = create_app(DevConfig)
    assert app.config['ENV'] == 'dev'
    assert app.config['DEBUG']
예제 #7
0
def test_production_config():
    """Production config."""
    app = create_app(ProdConfig)
    assert app.config["ENV"] == "prod"
    assert not app.config["DEBUG"]
예제 #8
0
def test_dev_config():
    """Development config."""
    app = create_app(DevConfig)
    assert app.config["ENV"] == "dev"
    assert app.config["DEBUG"]