mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Replaced use of TestCase.fail() with assertRaises().
Also removed try/except/fail antipattern that hides exceptions.
This commit is contained in:
@@ -198,13 +198,7 @@ class SessionTestsMixin(object):
|
||||
# removed the key) results in a new key being generated.
|
||||
try:
|
||||
session = self.backend('1')
|
||||
try:
|
||||
session.save()
|
||||
except AttributeError:
|
||||
self.fail(
|
||||
"The session object did not save properly. "
|
||||
"Middleware may be saving cache items without namespaces."
|
||||
)
|
||||
session.save()
|
||||
self.assertNotEqual(session.session_key, '1')
|
||||
self.assertIsNone(session.get('cat'))
|
||||
session.delete()
|
||||
|
||||
Reference in New Issue
Block a user