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_authentication.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'repoze/bfg/tests/test_authentication.py') diff --git a/repoze/bfg/tests/test_authentication.py b/repoze/bfg/tests/test_authentication.py index bce80ca20..d020a11a6 100644 --- a/repoze/bfg/tests/test_authentication.py +++ b/repoze/bfg/tests/test_authentication.py @@ -419,8 +419,8 @@ class TestAuthTktCookieHelper(unittest.TestCase): self.assertEqual(len(request.callbacks), 1) response = DummyResponse() request.callbacks[0](None, response) - self.assertEqual(len(response.headers.added), 3) - self.assertEqual(response.headers.added[0][0], 'Set-Cookie') + self.assertEqual(len(response.headerlist), 3) + self.assertEqual(response.headerlist[0][0], 'Set-Cookie') def test_remember(self): plugin = self._makeOne('secret') @@ -658,14 +658,7 @@ class DummyAuthTktModule(object): class BadTicket(Exception): pass -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