Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ccfc44

Browse files
committed
Refs #24652 -- Fixed a test failure in file_uploads tests on Windows.
Thanks to Tim Graham for the report.
1 parent d73176a commit 4ccfc44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/file_uploads/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def test_readonly_root(self):
533533
os.chmod(MEDIA_ROOT, 0o500)
534534
self.addCleanup(os.chmod, MEDIA_ROOT, 0o700)
535535
try:
536-
self.obj.testfile.save('foo.txt', SimpleUploadedFile('foo.txt', b'x'))
536+
self.obj.testfile.save('foo.txt', SimpleUploadedFile('foo.txt', b'x'), save=False)
537537
except OSError as err:
538538
self.assertEqual(err.errno, errno.EACCES)
539539
except Exception:
@@ -546,7 +546,7 @@ def test_not_a_directory(self):
546546
self.addCleanup(os.remove, UPLOAD_TO)
547547
with self.assertRaises(IOError) as exc_info:
548548
with SimpleUploadedFile('foo.txt', b'x') as file:
549-
self.obj.testfile.save('foo.txt', file)
549+
self.obj.testfile.save('foo.txt', file, save=False)
550550
# The test needs to be done on a specific string as IOError
551551
# is raised even without the patch (just not early enough)
552552
self.assertEqual(exc_info.exception.args[0],

0 commit comments

Comments
 (0)