def test_web_resource_processing_raises_with_debugging(self):
        routing = dict(__config__=dict(processor='pipeline.a_pipeline'))
        site_config = dict(debug=dict(allow=['localhost']))
        web_resource = self._create_configured_web_resource(routing, site_config)

        request = DummyRequest([''])
        request.client = address.IPv4Address('TCP', 'localhost', 1234)

        def raiser(baton):
            raise Exception()

        web_resource.processor_dependency.on_resource_ready(raiser)

        # rendering the request should result in an exception response
        web_resource.render(request)

        self.assertIn('web.Server Traceback (most recent call last)', ''.join(request.written))
        self.assertEquals(request.code, 500)