From 16e3636a1a99c0987d8cfb266c3584fedb763992 Mon Sep 17 00:00:00 2001 From: Paul McMillan Date: Mon, 21 Nov 2011 22:50:35 +0000 Subject: [PATCH] Fixed Python 2.5 test failure introduced in r17135. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17137 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/sessions/tests.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/django/contrib/sessions/tests.py b/django/contrib/sessions/tests.py index 58d052d67b4..9e23b5131f5 100644 --- a/django/contrib/sessions/tests.py +++ b/django/contrib/sessions/tests.py @@ -375,11 +375,12 @@ class SessionMiddlewareTests(unittest.TestCase): # Handle the response through the middleware response = middleware.process_response(request, response) - self.assertFalse( - response.cookies[settings.SESSION_COOKIE_NAME]['httponly']) - self.assertNotIn('httponly', - str(response.cookies[settings.SESSION_COOKIE_NAME]['httponly'])) - + #if it isn't in the cookie, that's fine (Python 2.5). + if 'httponly' in settings.SESSION_COOKIE_NAME: + self.assertFalse( + response.cookies[settings.SESSION_COOKIE_NAME]['httponly']) + self.assertNotIn('httponly', + str(response.cookies[settings.SESSION_COOKIE_NAME]['httponly'])) class CookieSessionTests(SessionTestsMixin, TestCase):