예제 #1
0
def build_real_request(wsgi_environ):
    """Build a Pyramid request, as if it was instantiated by Pyramid.
    """
    config = testing.setUp(settings=DEFAULT_SETTINGS)
    includeme(config)
    request = pyramid_request.Request(wsgi_environ)
    request.registry = config.registry
    return request
예제 #2
0
def build_real_request(wsgi_environ):
    """Build a Pyramid request, as if it was instantiated by Pyramid.
    """
    config = testing.setUp(settings=DEFAULT_SETTINGS)
    includeme(config)
    request = pyramid_request.Request(wsgi_environ)
    request.registry = config.registry
    return request
예제 #3
0
    def test_cliquet_includes_are_included_manually(self):
        config = Configurator(settings=cliquet.DEFAULT_SETTINGS)
        config.add_settings({'includes': 'elastic history'})
        config.route_prefix = 'v2'

        with mock.patch.object(config, 'include'):
            with mock.patch.object(config, 'scan'):
                cliquet.includeme(config)

                config.include.assert_any_call('elastic')
                config.include.assert_any_call('history')
예제 #4
0
    def test_cliquet_includes_are_included_manually(self):
        config = Configurator(settings=cliquet.DEFAULT_SETTINGS)
        config.add_settings({'includes': 'elastic history'})
        config.route_prefix = 'v2'

        with mock.patch.object(config, 'include'):
            with mock.patch.object(config, 'scan'):
                cliquet.includeme(config)

                config.include.assert_any_call('elastic')
                config.include.assert_any_call('history')