diff options
author | Tim Graham <timograham@gmail.com> | 2017-01-25 10:13:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-25 10:13:08 -0500 |
commit | 632c4ffd9cb1da273303bcd8005fff216506c795 (patch) | |
tree | 4e475379e7e210a513789513021720b8b4808f7c /tests/file_uploads | |
parent | 3f0c4fe18fe9850bb2f56be138012add4b54873d (diff) | |
download | django-632c4ffd9cb1da273303bcd8005fff216506c795.tar.gz |
Refs #23919 -- Replaced errno checking with PEP 3151 exceptions.
Diffstat (limited to 'tests/file_uploads')
-rw-r--r-- | tests/file_uploads/tests.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py index c7315ae142..827083412e 100644 --- a/tests/file_uploads/tests.py +++ b/tests/file_uploads/tests.py @@ -1,5 +1,4 @@ import base64 -import errno import hashlib import json import os @@ -564,9 +563,8 @@ class DirectoryCreationTests(SimpleTestCase): """Permission errors are not swallowed""" os.chmod(MEDIA_ROOT, 0o500) self.addCleanup(os.chmod, MEDIA_ROOT, 0o700) - with self.assertRaises(OSError) as cm: + with self.assertRaises(PermissionError): self.obj.testfile.save('foo.txt', SimpleUploadedFile('foo.txt', b'x'), save=False) - self.assertEqual(cm.exception.errno, errno.EACCES) def test_not_a_directory(self): """The correct IOError is raised when the upload directory name exists but isn't a directory""" |