def test_prod_config(self): """ Tests if the production config loads correctly """ app = create_app('cron_ui.settings.ProdConfig') assert app.config[ 'SQLALCHEMY_DATABASE_URI'] == 'sqlite:///../database.db' assert app.config['CACHE_TYPE'] == 'simple'
def test_test_config(self): """ Tests if the test config loads correctly """ app = create_app('cron_ui.settings.TestConfig') assert app.config['DEBUG'] is True assert app.config['SQLALCHEMY_ECHO'] is True assert app.config['CACHE_TYPE'] == 'null'
def test_dev_config(self): """ Tests if the development config loads correctly """ app = create_app('cron_ui.settings.DevConfig') assert app.config['DEBUG'] is True assert app.config[ 'SQLALCHEMY_DATABASE_URI'] == 'sqlite:///../database.db' assert app.config['CACHE_TYPE'] == 'null'
def testapp(request): app = create_app('cron_ui.settings.TestConfig') client = app.test_client() db.app = app db.create_all() if getattr(request.module, "create_user", True): admin = User('admin', 'supersafepassword') db.session.add(admin) db.session.commit() def teardown(): db.session.remove() db.drop_all() request.addfinalizer(teardown) return client
"""Module for running app with gunicorn.""" import os from cron_ui import create_app env = os.environ.get('ENV', 'prod') app = create_app('cron_ui.settings.%sConfig' % env.capitalize())