Switched to Python 3-compatible octal notation.

This commit is contained in:
Aymeric Augustin 2012-07-20 13:28:36 +02:00
parent 85cd458944
commit 324d48d0a7
4 changed files with 10 additions and 10 deletions

View file

@ -362,16 +362,16 @@ class DirectoryCreationTests(unittest.TestCase):
if not os.path.isdir(temp_storage.location):
os.makedirs(temp_storage.location)
if os.path.isdir(UPLOAD_TO):
os.chmod(UPLOAD_TO, 0700)
os.chmod(UPLOAD_TO, 0o700)
shutil.rmtree(UPLOAD_TO)
def tearDown(self):
os.chmod(temp_storage.location, 0700)
os.chmod(temp_storage.location, 0o700)
shutil.rmtree(temp_storage.location)
def test_readonly_root(self):
"""Permission errors are not swallowed"""
os.chmod(temp_storage.location, 0500)
os.chmod(temp_storage.location, 0o500)
try:
self.obj.testfile.save('foo.txt', SimpleUploadedFile('foo.txt', b'x'))
except OSError as err: