mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +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:
@@ -22,14 +22,14 @@ class HttpResponseBaseTests(SimpleTestCase):
|
||||
r = HttpResponseBase()
|
||||
self.assertIs(r.writable(), False)
|
||||
|
||||
with self.assertRaisesMessage(IOError, 'This HttpResponseBase instance is not writable'):
|
||||
with self.assertRaisesMessage(OSError, 'This HttpResponseBase instance is not writable'):
|
||||
r.write('asdf')
|
||||
with self.assertRaisesMessage(IOError, 'This HttpResponseBase instance is not writable'):
|
||||
with self.assertRaisesMessage(OSError, 'This HttpResponseBase instance is not writable'):
|
||||
r.writelines(['asdf\n', 'qwer\n'])
|
||||
|
||||
def test_tell(self):
|
||||
r = HttpResponseBase()
|
||||
with self.assertRaisesMessage(IOError, 'This HttpResponseBase instance cannot tell its position'):
|
||||
with self.assertRaisesMessage(OSError, 'This HttpResponseBase instance cannot tell its position'):
|
||||
r.tell()
|
||||
|
||||
def test_setdefault(self):
|
||||
|
||||
Reference in New Issue
Block a user