From a58c4a4968053314be39aae62eed3c7a9c863e40 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 7 Sep 2010 20:27:17 +0000 Subject: - Use ``hash()`` rather than ``id()`` when computing the "phash" of a custom route/view predicate in order to allow the custom predicate some control over which predicates are "equal". - Use ``response.headerlist.append`` instead of ``response.headers.add`` in ``repoze.bfg.request.add_global_response_headers`` in case the response is not a WebOb response. --- repoze/bfg/tests/test_request.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'repoze/bfg/tests/test_request.py') diff --git a/repoze/bfg/tests/test_request.py b/repoze/bfg/tests/test_request.py index 8d23e360f..0248e10be 100644 --- a/repoze/bfg/tests/test_request.py +++ b/repoze/bfg/tests/test_request.py @@ -206,7 +206,7 @@ class Test_add_global_response_headers(unittest.TestCase): self._callFUT(request, [('c', 1)]) self.assertEqual(len(request.response_callbacks), 1) request.response_callbacks[0](None, response) - self.assertEqual(response.headers.added, [('c', 1)] ) + self.assertEqual(response.headerlist, [('c', 1)] ) class DummyRequest: def __init__(self, environ=None): @@ -221,14 +221,8 @@ class DummyNewRequestEvent: def __init__(self, request): self.request = request -class DummyHeaders: - def __init__(self): - self.added = [] - def add(self, k, v): - self.added.append((k, v)) - class DummyResponse: def __init__(self): - self.headers = DummyHeaders() + self.headerlist = [] -- cgit v1.2.3