summaryrefslogtreecommitdiff
path: root/repoze/bfg/tests/test_authentication.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-06-11 03:15:15 +0000
committerChris McDonough <chrism@agendaless.com>2009-06-11 03:15:15 +0000
commitdfc2b65c1b6d2f938f68b7868a14d8f9a4faab9e (patch)
treef3241401b7175a401e00286b11e3efe3c21f5093 /repoze/bfg/tests/test_authentication.py
parentf8b0065b6ede54424d7a7b49f9f113e87634b5ab (diff)
downloadpyramid-dfc2b65c1b6d2f938f68b7868a14d8f9a4faab9e.tar.gz
pyramid-dfc2b65c1b6d2f938f68b7868a14d8f9a4faab9e.tar.bz2
pyramid-dfc2b65c1b6d2f938f68b7868a14d8f9a4faab9e.zip
Merge unifyroutesandtraversal branch into trunk
Diffstat (limited to 'repoze/bfg/tests/test_authentication.py')
-rw-r--r--repoze/bfg/tests/test_authentication.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/repoze/bfg/tests/test_authentication.py b/repoze/bfg/tests/test_authentication.py
index 09782cd3c..258fadfd2 100644
--- a/repoze/bfg/tests/test_authentication.py
+++ b/repoze/bfg/tests/test_authentication.py
@@ -361,20 +361,23 @@ class TestAuthTktCookieHelper(unittest.TestCase):
plugin = self._makeOne('secret')
old_val = self._makeTicket(userid='userid')
request = self._makeRequest({'HTTP_COOKIE':'auth_tkt=%s' % old_val})
- new_val = self._makeTicket(userid='other', userdata='userdata')
result = plugin.remember(request, 'other', userdata='userdata')
self.assertEqual(len(result), 3)
- self.assertEqual(result[0],
- ('Set-Cookie',
- 'auth_tkt="%s"; Path=/' % new_val))
- self.assertEqual(result[1],
- ('Set-Cookie',
- 'auth_tkt="%s"; Path=/; Domain=localhost'
- % new_val))
- self.assertEqual(result[2],
- ('Set-Cookie',
- 'auth_tkt="%s"; Path=/; Domain=.localhost'
- % new_val))
+
+ self.assertEqual(result[0][0], 'Set-Cookie')
+ self.failUnless(result[0][1].endswith('; Path=/'))
+ self.failUnless(result[0][1].startswith('auth_tkt='))
+ self.failIf(result[0][1].startswith('auth_tkt="%s"' % old_val))
+
+ self.assertEqual(result[1][0], 'Set-Cookie')
+ self.failUnless(result[1][1].endswith('; Path=/; Domain=localhost'))
+ self.failUnless(result[1][1].startswith('auth_tkt='))
+ self.failIf(result[1][1].startswith('auth_tkt="%s"' % old_val))
+
+ self.assertEqual(result[2][0], 'Set-Cookie')
+ self.failUnless(result[2][1].endswith('; Path=/; Domain=.localhost'))
+ self.failUnless(result[2][1].startswith('auth_tkt='))
+ self.failIf(result[2][1].startswith('auth_tkt="%s"' % old_val))
def test_remember_creds_different_include_ip(self):
plugin = self._makeOne('secret', include_ip=True)