From 844e98b01c5c6aa1585a76ac77f92bb8c1ef9d90 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 5 Sep 2010 04:58:23 +0000 Subject: Documentation ------------- - Add an API chapter for the ``repoze.bfg.request`` module, which includes documentation for the ``repoze.bfg.request.Request`` class (the "request object"). - Modify the "Request and Response" narrative chapter to reference the new ``repoze.bfg.request`` API chapter. Some content was moved from this chapter into the API documentation itself. Features -------- - A new ``repoze.bfg.request.Request.add_response_callback`` API has been added. This method is documented in the new ``repoze.bfg.request`` API chapter. It can be used to influence response values before a concrete response object has been created. Internal -------- - The (internal) feature which made it possible to attach a ``global_response_headers`` attribute to the request (which was assumed to contain a sequence of header key/value pairs which would later be added to the response by the router), has been removed. The functionality of ``repoze.bfg.request.Request.add_response_callback`` takes its place. --- repoze/bfg/tests/test_testing.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'repoze/bfg/tests/test_testing.py') diff --git a/repoze/bfg/tests/test_testing.py b/repoze/bfg/tests/test_testing.py index b24843e77..b900a44a4 100644 --- a/repoze/bfg/tests/test_testing.py +++ b/repoze/bfg/tests/test_testing.py @@ -514,6 +514,12 @@ class TestDummyRequest(unittest.TestCase): request = self._makeOne(water = 1) self.assertEqual(request.water, 1) + def test_add_response_callback(self): + request = self._makeOne() + request.add_response_callback(1) + self.assertEqual(request.response_callbacks, [1]) + + class TestDummyTemplateRenderer(unittest.TestCase): def _getTargetClass(self, ): from repoze.bfg.testing import DummyTemplateRenderer -- cgit v1.2.3