From 1ac2bb9b8e299e82e64d77cd97028dc907342dd8 Mon Sep 17 00:00:00 2001 From: Paul McMillan Date: Wed, 5 Oct 2011 05:21:47 +0000 Subject: [PATCH] Fixed #16987 -- Improved error message for session tests. Thanks jMyles and DiskSpace for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16926 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/sessions/tests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django/contrib/sessions/tests.py b/django/contrib/sessions/tests.py index 95e8e901a8e..776e03c081c 100644 --- a/django/contrib/sessions/tests.py +++ b/django/contrib/sessions/tests.py @@ -162,7 +162,10 @@ class SessionTestsMixin(object): # removed the key) results in a new key being generated. try: session = self.backend('1') - session.save() + try: + session.save() + except AttributeError: + self.fail("The session object did not save properly. Middleware may be saving cache items without namespaces.") self.assertNotEqual(session.session_key, '1') self.assertEqual(session.get('cat'), None) session.delete()