summaryrefslogtreecommitdiff
path: root/tests/file_storage
AgeCommit message (Collapse)Author
2021-05-14[2.2.x] Refs #32718 -- Fixed file_storage.test_generate_filename and ↵Mariusz Felisiak
model_fields.test_filefield tests on Python 3.5.
2021-05-13[2.2.x] Fixed #32718 -- Relaxed file name validation in FileField.Mariusz Felisiak
- Validate filename returned by FileField.upload_to() not a filename passed to the FileField.generate_filename() (upload_to() may completely ignored passed filename). - Allow relative paths (without dot segments) in the generated filename. Thanks to Jakub Kleň for the report and review. Thanks to all folks for checking this patch on existing projects. Thanks Florian Apolloner and Markus Holtermann for the discussion and implementation idea. Regression in 0b79eb36915d178aef5c6a7bbce71b1e76d376d3. Backport of b55699968fc9ee985384c64e37f6cc74a0a23683 from main.
2021-05-06[2.2.x] Refs CVE-2021-31542 -- Skipped mock AWS storage test on Windows.Carlton Gibson
The validate_file_name() sanitation introduced in 0b79eb36915d178aef5c6a7bbce71b1e76d376d3 correctly rejects the example file name as containing path elements on Windows. This breaks the test introduced in 914c72be2abb1c6dd860cb9279beaa66409ae1b2 to allow path components for storages that may allow them. Test is skipped pending a discussed storage refactoring to support this use-case. Backport of a708f39ce67af174df90c5b5e50ad1976cec7cb8 from main
2021-04-27[2.2.x] Fixed CVE-2021-31542 -- Tightened path & file name sanitation in ↵Florian Apolloner
file uploads.
2020-08-25[2.2.x] Fixed CVE-2020-24583, #31921 -- Fixed permissions on ↵Mariusz Felisiak
intermediate-level static and storage directories on Python 3.7+. Thanks WhiteSage for the report. Backport of ea0febbba531a3ecc8c77b570efbfb68ca7155db from master.
2018-12-31Updated test URL patterns to use path() and re_path().Tim Graham
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
2017-03-01Refs #27836 -- Fixed cleanup exception in file_storage test.Vytis Banaitis
TemporaryDirectory tries to delete the directory that was already removed.
2017-02-24Fixed #27836 -- Allowed FileSystemStorage.delete() to remove directories.chillaranand
2017-02-03Fixed spelling of "nonexistent".Tim Graham
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-25Refs #23919 -- Replaced errno checking with PEP 3151 exceptions.Tim Graham
2017-01-20Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham
These functions do nothing on Python 3.
2017-01-20Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2.Tim Graham
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2017-01-17Refs #26058 -- Removed deprecated FileField.get_directory_name()/get_filename().Tim Graham
2017-01-17Refs #23832 -- Removed deprecated non-timezone aware Storage API.Tim Graham
2016-12-07Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase.Tim Graham
2016-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
2016-10-27Fixed #27327 -- Simplified time zone handling by requiring pytz.Tim Graham
2016-08-09Fixed #13809 -- Made FieldFile.open() respect its mode argument.Chris Sinchok
2016-07-29Fixed #26896 -- Allowed a lazy base_url for FileSystemStorage.Tomas Pazderka
2016-06-18Refs #26772 -- Added a test for FileField reopening closed files.Paul J Stevens
Thanks Simon Charette for review.
2016-06-18Reverted "Fixed #26644 -- Allowed wrapping NamedTemporaryFile with File."Tim Graham
This reverts commit 1b407050dd53e56686fdd3e168f8cac4f9be8306 as it introduces a regression in the test for refs #26772.
2016-06-17Reverted "Fixed #26398 -- Made FieldFile.open() respect its mode argument."Tim Graham
This reverts commit a52a531a8b34f049fba11c3ee7b010af7534bf90 due to regressions described in refs #26772.
2016-06-14Fixed #26644 -- Allowed wrapping NamedTemporaryFile with File.Hugo Osvaldo Barrera
914c72be2abb1c6dd860cb9279beaa66409ae1b2 introduced a regression that causes saving a NamedTemporaryFile in a FileField to raise a SuspiciousFileOperation. To remedy this, if a File has an absolute path as a filename, use only the basename as the filename.
2016-06-06Refs #26712 -- Removed workarounds for PostgreSQL queries on TIME_ZONE changes.Simon Charette
2016-04-30Fixed #26058 -- Delegated os.path bits of FileField's filename generation to ↵Cristiano
the Storage.
2016-04-21Fixed #26495 -- Added name arg to Storage.save()'s File wrapping.Maxim Novikov
2016-04-08Fixed E128 flake8 warnings in tests/.Tim Graham
2016-04-03Fixed #25905 -- Prevented leading slashes in urljoin() callsrixx
Leading slashes in the second urljoin argument will return exactly that argument, breaking FileSystemStorage.url behavior if called with a parameter with leading slashes. Also added test cases for null bytes and None. Thanks to Markus for help and review.
2016-03-23Fixed #26398 -- Made FieldFile.open() respect its mode argument.Alexey Kotlyarov
2016-02-23Fixed #23832 -- Added timezone aware Storage API.James Aylett
New Storage.get_{accessed,created,modified}_time() methods convert the naive time from now-deprecated {accessed,created_modified}_time() methods into aware objects in UTC if USE_TZ=True.
2016-01-29Refs #26022 -- Used context manager version of assertRaisesMessage in tests.Hasan
2016-01-29Refs #26022 -- Used context manager version of assertRaises in tests.Hasan
2016-01-07Fixed #26038 -- Changed FileSystemStorage defaults on setting change.Simon Charette
Thanks to Dave Voutila for the report and Tim for the review.
2015-10-01Fixed #21042 -- Allowed accessing FileDescriptor on the model class.Tim Graham
This is consistent with ability to reference other descriptors on the model class (5ef0c03ae9aca99289737ba6d88a371ad95cf432).
2015-09-23Refs #9893 -- Removed shims for lack of max_length support in file storage ↵Tim Graham
per deprecation timeline.
2015-06-24Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham
Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
2015-05-22Fixed #24826 -- Accounted for filesystem-dependent filename max lengthClaude Paroz
Thanks Raphaël Hertzog for the report and help on the patch, and Tim Graham for the review.
2015-05-20Fixed typo in file_storage tests.Tim Graham
2015-05-20Refs #24652 -- Enforced test isolation in file_storage tests.Simon Charette