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
This commit is contained in:
Paul McMillan 2011-10-05 05:21:47 +00:00
parent 749f0721c4
commit 1ac2bb9b8e
1 changed files with 4 additions and 1 deletions

View File

@ -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()