def test_implicit_disabled(): morepath.disable_implicit() class app(morepath.App): pass @app.path(path='') class Model(object): def __init__(self): pass @reg.dispatch() def one(): return "default one" @app.view(model=Model) def default(self, request): try: return one() except reg.NoImplicitLookupError: return "No implicit found" dectate.commit(app) c = Client(app()) response = c.get('/') assert response.body == b'No implicit found'
def test_implicit_disabled(): morepath.disable_implicit() config = morepath.setup() class app(morepath.App): testing_config = config @app.path(path='') class Model(object): def __init__(self): pass @reg.dispatch() def one(): return "default one" @app.view(model=Model) def default(self, request): try: return one() except reg.NoImplicitLookupError: return "No implicit found" config.commit() c = Client(app()) response = c.get('/') assert response.body == b'No implicit found'
def setup_module(module): morepath.disable_implicit()
def setup_module(module): with pytest.deprecated_call(): morepath.disable_implicit()