mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #30137 -- Replaced OSError aliases with the canonical OSError.
Used more specific errors (e.g. FileExistsError) as appropriate.
This commit is contained in:
4
tests/cache/tests.py
vendored
4
tests/cache/tests.py
vendored
@@ -1448,8 +1448,8 @@ class FileBasedCacheTests(BaseCacheTests, TestCase):
|
||||
self.assertEqual(cache.get('foo', 'baz'), 'baz')
|
||||
|
||||
def test_get_does_not_ignore_non_filenotfound_exceptions(self):
|
||||
with mock.patch('builtins.open', side_effect=IOError):
|
||||
with self.assertRaises(IOError):
|
||||
with mock.patch('builtins.open', side_effect=OSError):
|
||||
with self.assertRaises(OSError):
|
||||
cache.get('foo')
|
||||
|
||||
def test_empty_cache_file_considered_expired(self):
|
||||
|
||||
Reference in New Issue
Block a user