summaryrefslogtreecommitdiff
path: root/tests/model_fields/test_filefield.py
AgeCommit message (Collapse)Author
2026-01-29Fixed #36847 -- Ensured auto_now_add fields are set on pre_save().Nilesh Kumar Pahari
Regression in 94680437a45a71c70ca8bd2e68b72aa1e2eff337. Refs #27222. During INSERT operations, `field.pre_save()` is called to prepare values for db insertion. The `add` param must be `True` for `auto_now_add` fields to be populated. The regression commit passed `False`, causing `auto_now_add` fields to remain `None` when used by other fields, such as `upload_to` callables. Thanks Ran Benita for the report.
2025-01-20Fixed #36005 -- Dropped support for Python 3.10 and 3.11.Mariusz Felisiak
2024-05-15Fixed #35384 -- Raised FieldError when saving a file without a name to ↵Jonny Park
FileField.
2022-12-30Refs #34100 -- Made file upload tests use Storage.exists() where appropriate.Francesco Panico
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-05-13Fixed #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.
2020-07-24Fixed #31812 -- Fixed FileField.model for fields defined in abstract models.Matthias Kestenholz
Regression in a93425a37f4defdb31d4ca96bb3bf6da21f0b5ce.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2020-01-31Used temporary directory in FileFieldTests.test_pickle().Mariusz Felisiak
Using the current directory caused a PermissionError.
2020-01-09Added file cleanup in FileFieldTests.test_pickle().Carlton Gibson
2020-01-09Fixed #21238 -- Fixed restoring attributes when pickling FileField and ↵Hasan Ramezani
ImageField.
2020-01-09Refs #21238 -- Added more tests for pickling FileField and ImageField.Hasan Ramezani
2019-11-07Refs #29983 -- Added support for using pathlib.Path in all settings.Jon Dufresne
2019-11-06Harmonized Windows checks in tests to a single style.Jon Dufresne
2017-05-31Refs #27777 -- Improved docs/added test for File context manager change.Ingo Klöcker
2016-10-28Fixed #27188 -- Allowed using unique=True with FileField.Michael Scott
Thanks Tim Graham for the initial patch.
2016-10-26Fixed #27334 -- Allowed FileField to move rather than copy a file.Adam Chidlow
When a FileField is set to an instance of File that is not also an instance of FieldFile, pre_save() passes that object as the contents to Storage.save(). This allows the file to be moved rather than copied to the upload destination.
2016-07-16Fixed #26900 -- Fixed crash accessing deferred FileFields.Tim Graham
2016-03-23Split model_fields tests into different files.Tim Graham