summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-09-08 21:25:57 +0200
committerClaude Paroz <claude@2xlibre.net>2012-09-08 21:31:46 +0200
commitd7853c55ed027cdffcda88205b9d5c16861a5bcb (patch)
tree7137c73da59b78234a620557c10fe0e3622ec400
parent3bdb65dc5959b62f910ca498cce19682e2db6308 (diff)
Removed warning check in test_load_overlong_key
Some backends issue a warning here, others not. This is not the primary goal of the test, so the assertion about the warning has been removed. Thanks Carl Meyer for noticing the issue and suggesting the fix.
-rw-r--r--django/contrib/sessions/tests.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/django/contrib/sessions/tests.py b/django/contrib/sessions/tests.py
index 7de2941122..d738100af0 100644
--- a/django/contrib/sessions/tests.py
+++ b/django/contrib/sessions/tests.py
@@ -302,11 +302,10 @@ class CacheDBSessionTests(SessionTestsMixin, TestCase):
self.assertTrue(self.session.exists(self.session.session_key))
def test_load_overlong_key(self):
- with warnings.catch_warnings(record=True) as w:
- warnings.simplefilter("always")
+ # Some backends might issue a warning
+ with warnings.catch_warnings():
self.session._session_key = (string.ascii_letters + string.digits) * 20
self.assertEqual(self.session.load(), {})
- self.assertEqual(len(w), 1)
@override_settings(USE_TZ=True)
@@ -352,11 +351,10 @@ class CacheSessionTests(SessionTestsMixin, unittest.TestCase):
backend = CacheSession
def test_load_overlong_key(self):
- with warnings.catch_warnings(record=True) as w:
- warnings.simplefilter("always")
+ # Some backends might issue a warning
+ with warnings.catch_warnings():
self.session._session_key = (string.ascii_letters + string.digits) * 20
self.assertEqual(self.session.load(), {})
- self.assertEqual(len(w), 1)
class SessionMiddlewareTests(unittest.TestCase):