Fixed #14096 -- Corrected Python 2.4 syntax issue. Thanks to PaulM for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13579 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2010-08-14 12:11:02 +00:00
parent b3dc3a0106
commit 597e03cd74
1 changed files with 18 additions and 18 deletions

View File

@ -207,32 +207,32 @@ class SessionTestsMixin(object):
# Tests get_expire_at_browser_close with different settings and different # Tests get_expire_at_browser_close with different settings and different
# set_expiry calls # set_expiry calls
try: try:
original_expire_at_browser_close = settings.SESSION_EXPIRE_AT_BROWSER_CLOSE try:
settings.SESSION_EXPIRE_AT_BROWSER_CLOSE = False original_expire_at_browser_close = settings.SESSION_EXPIRE_AT_BROWSER_CLOSE
settings.SESSION_EXPIRE_AT_BROWSER_CLOSE = False
self.session.set_expiry(10) self.session.set_expiry(10)
self.assertFalse(self.session.get_expire_at_browser_close()) self.assertFalse(self.session.get_expire_at_browser_close())
self.session.set_expiry(0) self.session.set_expiry(0)
self.assertTrue(self.session.get_expire_at_browser_close()) self.assertTrue(self.session.get_expire_at_browser_close())
self.session.set_expiry(None) self.session.set_expiry(None)
self.assertFalse(self.session.get_expire_at_browser_close()) self.assertFalse(self.session.get_expire_at_browser_close())
settings.SESSION_EXPIRE_AT_BROWSER_CLOSE = True settings.SESSION_EXPIRE_AT_BROWSER_CLOSE = True
self.session.set_expiry(10) self.session.set_expiry(10)
self.assertFalse(self.session.get_expire_at_browser_close()) self.assertFalse(self.session.get_expire_at_browser_close())
self.session.set_expiry(0) self.session.set_expiry(0)
self.assertTrue(self.session.get_expire_at_browser_close()) self.assertTrue(self.session.get_expire_at_browser_close())
self.session.set_expiry(None) self.session.set_expiry(None)
self.assertTrue(self.session.get_expire_at_browser_close()) self.assertTrue(self.session.get_expire_at_browser_close())
except:
raise
except:
raise
finally: finally:
settings.SESSION_EXPIRE_AT_BROWSER_CLOSE = original_expire_at_browser_close settings.SESSION_EXPIRE_AT_BROWSER_CLOSE = original_expire_at_browser_close