Example #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
Example #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
    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')
    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')