mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #36500 -- Rewrapped long docstrings and block comments via a script.
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
This commit is contained in:
@@ -359,7 +359,8 @@ class FileStorageTests(SimpleTestCase):
|
||||
self.storage.url("""a/b\\c.file"""), "/test_media_url/a/b/c.file"
|
||||
)
|
||||
|
||||
# #25905: remove leading slashes from file names to prevent unsafe url output
|
||||
# #25905: remove leading slashes from file names to prevent unsafe url
|
||||
# output
|
||||
self.assertEqual(self.storage.url("/evil.com"), "/test_media_url/evil.com")
|
||||
self.assertEqual(self.storage.url(r"\evil.com"), "/test_media_url/evil.com")
|
||||
self.assertEqual(self.storage.url("///evil.com"), "/test_media_url/evil.com")
|
||||
@@ -406,8 +407,8 @@ class FileStorageTests(SimpleTestCase):
|
||||
|
||||
def test_file_storage_prevents_directory_traversal(self):
|
||||
"""
|
||||
File storage prevents directory traversal (files can only be accessed if
|
||||
they're below the storage location).
|
||||
File storage prevents directory traversal (files can only be accessed
|
||||
if they're below the storage location).
|
||||
"""
|
||||
with self.assertRaises(SuspiciousFileOperation):
|
||||
self.storage.exists("..")
|
||||
@@ -434,7 +435,8 @@ class FileStorageTests(SimpleTestCase):
|
||||
|
||||
def test_makedirs_race_handling(self):
|
||||
"""
|
||||
File storage should be robust against directory creation race conditions.
|
||||
File storage should be robust against directory creation race
|
||||
conditions.
|
||||
"""
|
||||
real_makedirs = os.makedirs
|
||||
|
||||
@@ -824,7 +826,8 @@ class FileFieldStorageTests(TestCase):
|
||||
obj.normal.close()
|
||||
|
||||
def test_duplicate_filename(self):
|
||||
# Multiple files with the same name get _(7 random chars) appended to them.
|
||||
# Multiple files with the same name get _(7 random chars) appended to
|
||||
# them.
|
||||
tests = [
|
||||
("multiple_files", "txt"),
|
||||
("multiple_files_many_extensions", "tar.gz"),
|
||||
@@ -861,7 +864,8 @@ class FileFieldStorageTests(TestCase):
|
||||
self.assertEqual(names[0], "tests/%s" % filename)
|
||||
self.assertRegex(names[1], "tests/fi_%s.ext" % FILE_SUFFIX_REGEX)
|
||||
|
||||
# Testing exception is raised when filename is too short to truncate.
|
||||
# Testing exception is raised when filename is too short to
|
||||
# truncate.
|
||||
filename = "short.longext"
|
||||
objs[0].limited_length.save(filename, ContentFile("Same Content"))
|
||||
with self.assertRaisesMessage(
|
||||
|
||||
Reference in New Issue
Block a user