def app(): """An application for the tests.""" _app = create_app(config=TestConfig) ctx = _app.test_request_context() ctx.push() yield _app ctx.pop()
def app(): """An application for the tests.""" _app = create_app(config=TestConfig) ctx = _app.test_request_context() ctx.push() try: yield _app finally: ctx.pop()
def api(): """An api instance for the tests, no manager""" import os # the mere presence of the env var should prevent the manage # blueprint from being registered os.environ['DOORMAN_NO_MANAGER'] = '1' _app = create_app(config=TestConfig) ctx = _app.test_request_context() ctx.push() try: yield _app finally: ctx.pop()
# -*- coding: utf-8 -*- from doorman.application import create_app from doorman.settings import CurrentConfig from doorman.tasks import celery # noqa app = create_app(config=CurrentConfig)
# -*- coding: utf-8 -*- import os from doorman.application import create_app from doorman.settings import DevConfig, ProdConfig, TestConfig from doorman.tasks import celery if os.environ.get('DOORMAN_ENV') == 'prod': CONFIG = ProdConfig elif os.environ.get('DOORMAN_ENV') == 'test': CONFIG = TestConfig else: CONFIG = DevConfig app = create_app(config=CONFIG)
# -*- coding: utf-8 -*- import os from doorman.application import create_app from doorman.settings import DevConfig, ProdConfig, TestConfig if os.environ.get('DOORMAN_ENV') == 'prod': CONFIG = ProdConfig elif os.environ.get('DOORMAN_ENV') == 'test': CONFIG = TestConfig else: CONFIG = DevConfig app = create_app(config=CONFIG) from doorman.tasks import celery