예제 #1
0
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'
예제 #2
0
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'
예제 #3
0
def setup_module(module):
    morepath.disable_implicit()
예제 #4
0
def setup_module(module):
    morepath.disable_implicit()
예제 #5
0
def setup_module(module):
    with pytest.deprecated_call():
        morepath.disable_implicit()
예제 #6
0
def setup_module(module):
    with pytest.deprecated_call():
        morepath.disable_implicit()