summaryrefslogtreecommitdiff
path: root/tests/file_storage/tests.py
AgeCommit message (Collapse)Author
2025-11-26Closed temporary files in ↵Jacob Walls
OverwritingStorageTests.test_save_overwrite_behavior_temp_file().
2025-10-15Fixed 36622 -- Prevented LazyObject FileField storages from evaluating at ↵Clifford Gama
boot time. Co-authored-by: Fabien MICHEL <fmichel@adista.fr>
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-05-23Fixed flakiness in ↵Nick Pope
file_storage.tests.CustomStorageTests.test_file_get_accessed_time. Two separate calls to look up access time can result in sub-second differences which cause the test to fail. Also made the equivalent tests for ctime and mtime have the same changes to ensure that they won't flake in the same way in future.
2025-02-18Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.Mariusz Felisiak
datetime.UTC was added in Python 3.11.
2025-02-17Fixed #36191 -- Truncated the overwritten file content in FileSystemStorage.Gaël Utard
2025-01-15Refs #35326 -- Removed FileSystemStorage.OS_OPEN_FLAGS per deprecation timeline.Sarah Boyce
2024-08-28Refs #35326 -- Adjusted deprecation warning stacklevel in ↵Simon Charette
FileSystemStorage.OS_OPEN_FLAGS.
2024-08-15Refs #35658 -- Fixed ↵Mariusz Felisiak
test_create_file_field_from_another_file_field_in_memory_storage when run in reverse.
2024-08-09Fixed #35658 -- Initialized InMemoryFileNode instances with a name.lucasesposito
2024-08-05Fixed #35657 -- Made FileField handle db_default values.Sarah Boyce
2024-07-24Fixed #35604, Refs #35326 -- Made FileSystemStorage.exists() behaviour ↵Sarah Boyce
independent from allow_overwrite. Partially reverts 0b33a3abc2ca7d68a24f6d0772bc2b9fa603744e. Storage.exists(name) was documented to "return False if the name is available for a new file." but return True if the file exists. This is ambiguous in the overwrite file case. It will now always return whether the file exists. Thank you to Natalia Bidart and Josh Schneier for the review.
2024-07-09Fixed CVE-2024-39330 -- Added extra file name validation in Storage's save ↵Natalia
method. Thanks to Josh Schneier for the report, and to Carlton Gibson and Sarah Boyce for the reviews.
2024-05-21Fixed #35326 -- Added allow_overwrite parameter to FileSystemStorage.Ben Cail
2024-02-20Fixed #23759 -- Preserved all file extensions in Storage.get_available_name().Adam Zapletal
2023-12-31Used addCleanup() in tests where appropriate.Mariusz Felisiak
2023-09-18Refs #26029 -- Removed DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings.Mariusz Felisiak
This also removes django.core.files.storage.get_storage_class(). Per deprecation timeline.
2023-08-22Removed unnecessary trailing commas in tests.konsti
2023-01-23Fixed #34192 -- Preserved callable storage when it returns default_storage.Matt Westcott
2023-01-12Refs #26029 -- Deprecated DEFAULT_FILE_STORAGE and STATICFILES_STORAGE settings.Jarosław Wygoda
2023-01-12Fixed #26029 -- Allowed configuring custom file storage backends.Jarosław Wygoda
2022-11-11Refs #34110 -- Reorganized django.core.files.storage into a separate module.Francesco Panico
2022-03-24Refs #32365 -- Removed internal uses of utils.timezone.utc alias.Carlton Gibson
Remaining test case ensures that uses of the alias are mapped canonically by the migration writer.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-01-04Fixed CVE-2021-45452 -- Fixed potential path traversal in storage subsystem.Florian Apolloner
Thanks to Dennis Brinkrolf for the report.
2021-07-29Fixed 32956 -- Lowercased spelling of "web" and "web framework" where ↵David Smith
appropriate.
2021-06-02Fixed #28154 -- Prevented infinite loop in FileSystemStorage.save() when a ↵Jacob Walls
broken symlink with the same name exists.
2021-03-19Refs #32508 -- Raised Type/ValueError instead of using "assert" in django.core.Daniyal
2020-09-02Fixed #31941 -- Corrected FileField.deconstruct() with a callable storage.Brian Helba
2020-09-01Fixed CVE-2020-24583, #31921 -- Fixed permissions on intermediate-level ↵Mariusz Felisiak
static and storage directories on Python 3.7+. Thanks WhiteSage for the report.
2020-04-08Refs #28184 -- Added test for FileField storage default.Carlton Gibson
Co-authored-by: miigotu <miigotu@gmail.com>
2020-04-08Fixed #28184 -- Allowed using a callable for FileField and ImageField storage.miigotu
2019-11-06Harmonized Windows checks in tests to a single style.Jon Dufresne
2019-10-31Refs #28428 -- Made FileSystemStorage.save() to support pathlib.Path.Hasan Ramezani
2019-10-31Refs #28428 -- Added tests for using FileSystemStorage with pathlib.Path.Hasan Ramezani
2019-09-25Fixed #25598 -- Added SCRIPT_NAME prefix to STATIC_URL and MEDIA_URL set to ↵Oleg Kainov
relative paths. Thanks Florian Apolloner for reviews. Co-authored-by: Joel Dunham <Joel.Dunham@technicalsafetybc.ca>
2019-08-18Refs #28428 -- Made FileField.upload_to support pathlib.Path.Claude Paroz
2019-08-18Refs #28428 -- Added test for a callable FileField.upload_to that returns ↵Claude Paroz
pathlib.Path.
2019-08-07Corrected several typos in string literals and test names.Min ho Kim
2019-01-31Fixed #30147 -- Simplified directory creation with os.makedirs(..., ↵Jon Dufresne
exist_ok=True).
2019-01-28Fixed #30137 -- Replaced OSError aliases with the canonical OSError.Jon Dufresne
Used more specific errors (e.g. FileExistsError) as appropriate.
2018-10-31Fixed #29890 -- Fixed FileSystemStorage crash if concurrent saves try to ↵Tim Graham
create the same directory. Regression in 632c4ffd9cb1da273303bcd8005fff216506c795.
2018-10-09Capitalized "Python" in docs and comments.Jon Dufresne
2018-09-28Refs #28909 -- Simplifed code using unpacking generalizations.Sergey Fedoseev
2018-07-10Fixed ResourceWarning from unclosed test files.Jon Dufresne
When running Django tests with Python warnings enabled.
2018-06-29Fixed #28144 -- Added FileSystemStorage.OS_OPEN_FLAGS to allow customization.Jon Prindiville
2018-04-27Removed urllib2 reference in file storage testsClaude Paroz
2017-06-01Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.Jon Dufresne
2017-05-25Fixed #28224 -- Tested for SuspiciousOperation subclasses in Django's tests.Rajesh Veeranki