Commit Graph

86 Commits

Author SHA1 Message Date
Jon Dufresne 7785e03ba8 Fixed #30137 -- Replaced OSError aliases with the canonical OSError.
Used more specific errors (e.g. FileExistsError) as appropriate.
2019-01-28 11:15:06 -05:00
Tim Graham 043bd70942 Updated test URL patterns to use path() and re_path(). 2018-12-31 10:47:32 -05:00
Tim Graham 98ef3829e9 Fixed #29890 -- Fixed FileSystemStorage crash if concurrent saves try to create the same directory.
Regression in 632c4ffd9c.
2018-10-31 19:28:11 -04:00
Jon Dufresne e90af8bad4 Capitalized "Python" in docs and comments. 2018-10-09 09:26:07 -04:00
Sergey Fedoseev 8ef8bc0f64 Refs #28909 -- Simplifed code using unpacking generalizations. 2018-09-28 09:57:12 -04:00
Jon Dufresne e7d7d47b93 Fixed ResourceWarning from unclosed test files.
When running Django tests with Python warnings enabled.
2018-07-10 12:26:19 +02:00
Jon Prindiville b4cba4ed62 Fixed #28144 -- Added FileSystemStorage.OS_OPEN_FLAGS to allow customization. 2018-06-29 15:51:59 -04:00
Claude Paroz 8e960c5aba Removed urllib2 reference in file storage tests 2018-04-27 14:02:39 +02:00
Jon Dufresne 2c69824e5a Refs #23968 -- Removed unnecessary lists, generators, and tuple calls. 2017-06-01 19:08:59 -04:00
Rajesh Veeranki 67e1afb4a8 Fixed #28224 -- Tested for SuspiciousOperation subclasses in Django's tests. 2017-05-25 08:19:01 -04:00
Vytis Banaitis 9cbf48693d Refs #27836 -- Fixed cleanup exception in file_storage test.
TemporaryDirectory tries to delete the directory that was already removed.
2017-03-01 12:52:28 -05:00
chillaranand e4025563ea Fixed #27836 -- Allowed FileSystemStorage.delete() to remove directories. 2017-02-24 16:02:33 -05:00
Tim Graham 29f607927f Fixed spelling of "nonexistent". 2017-02-03 08:01:45 -05:00
chillaranand d6eaf7c018 Refs #23919 -- Replaced super(ClassName, self) with super(). 2017-01-25 12:23:46 -05:00
Tim Graham 632c4ffd9c Refs #23919 -- Replaced errno checking with PEP 3151 exceptions. 2017-01-25 10:13:08 -05:00
Tim Graham 4e729feaa6 Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.
These functions do nothing on Python 3.
2017-01-20 08:01:02 -05:00
Tim Graham 109b33f64c Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2. 2017-01-20 08:49:47 +01:00
Claude Paroz 2b281cc35e Refs #23919 -- Removed most of remaining six usage
Thanks Tim Graham for the review.
2017-01-18 21:33:28 +01:00
Claude Paroz d7b9aaa366 Refs #23919 -- Removed encoding preambles and future imports 2017-01-18 09:55:19 +01:00
Tim Graham 0dfc5479a8 Refs #26058 -- Removed deprecated FileField.get_directory_name()/get_filename(). 2017-01-17 20:52:04 -05:00
Tim Graham 2d7fb77987 Refs #23832 -- Removed deprecated non-timezone aware Storage API. 2017-01-17 20:52:03 -05:00
Tim Graham b5f0b3478d Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase. 2016-12-07 17:42:31 -05:00
za 321e94fa41 Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings. 2016-11-10 21:30:21 -05:00
Tim Graham 414ad25b09 Fixed #27327 -- Simplified time zone handling by requiring pytz. 2016-10-27 08:53:20 -04:00
Chris Sinchok ac1975b18b Fixed #13809 -- Made FieldFile.open() respect its mode argument. 2016-08-09 12:53:18 -04:00
Tomas Pazderka b820b6108a Fixed #26896 -- Allowed a lazy base_url for FileSystemStorage. 2016-07-29 14:13:54 -04:00
Paul J Stevens b45852c263 Refs #26772 -- Added a test for FileField reopening closed files.
Thanks Simon Charette for review.
2016-06-18 11:06:56 -04:00
Tim Graham cd217de610 Reverted "Fixed #26644 -- Allowed wrapping NamedTemporaryFile with File."
This reverts commit 1b407050dd as it
introduces a regression in the test for refs #26772.
2016-06-18 11:06:56 -04:00
Tim Graham 7def55c3f6 Reverted "Fixed #26398 -- Made FieldFile.open() respect its mode argument."
This reverts commit a52a531a8b due to
regressions described in refs #26772.
2016-06-17 21:04:02 -04:00
Hugo Osvaldo Barrera 1b407050dd Fixed #26644 -- Allowed wrapping NamedTemporaryFile with File.
914c72be2a 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-14 09:28:08 -04:00
Simon Charette 271581df60 Refs #26712 -- Removed workarounds for PostgreSQL queries on TIME_ZONE changes. 2016-06-06 11:26:21 -04:00
Cristiano 914c72be2a Fixed #26058 -- Delegated os.path bits of FileField's filename generation to the Storage. 2016-04-30 17:22:40 -04:00
Maxim Novikov 4d1c229ee5 Fixed #26495 -- Added name arg to Storage.save()'s File wrapping. 2016-04-21 10:40:48 -04:00
Tim Graham 92053acbb9 Fixed E128 flake8 warnings in tests/. 2016-04-08 10:12:33 -04:00
rixx fdf5cd3429 Fixed #25905 -- Prevented leading slashes in urljoin() calls
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-04-03 17:21:56 +02:00
Alexey Kotlyarov a52a531a8b Fixed #26398 -- Made FieldFile.open() respect its mode argument. 2016-03-23 10:05:26 -04:00
James Aylett 1ff6e37de4 Fixed #23832 -- Added timezone aware Storage API.
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-02-23 18:51:43 -05:00
Hasan 253adc2b8a Refs #26022 -- Used context manager version of assertRaisesMessage in tests. 2016-01-29 13:03:39 -05:00
Hasan 3d0dcd7f5a Refs #26022 -- Used context manager version of assertRaises in tests. 2016-01-29 12:32:18 -05:00
Simon Charette 56c461a0d7 Fixed #26038 -- Changed FileSystemStorage defaults on setting change.
Thanks to Dave Voutila for the report and Tim for the review.
2016-01-07 12:04:39 -05:00
Tim Graham 9f6b704769 Fixed #21042 -- Allowed accessing FileDescriptor on the model class.
This is consistent with ability to reference other descriptors
on the model class (5ef0c03ae9).
2015-10-01 15:19:39 -04:00
Tim Graham 1bb6ecf6d3 Refs #9893 -- Removed shims for lack of max_length support in file storage per deprecation timeline. 2015-09-23 19:31:10 -04:00
Tim Graham aaacaeb096 Renamed RemovedInDjangoXYWarnings for new roadmap.
Forwardport of ae1d663b79
from stable/1.8.x plus more.
2015-06-24 16:08:20 -04:00
Claude Paroz 170f7115bb Fixed #24826 -- Accounted for filesystem-dependent filename max length
Thanks Raphaël Hertzog for the report and help on the patch, and Tim Graham
for the review.
2015-05-22 20:06:31 +02:00
Tim Graham e2b77acedd Fixed typo in file_storage tests. 2015-05-20 13:05:41 -04:00
Simon Charette 3db21c351b Refs #24652 -- Enforced test isolation in file_storage tests. 2015-05-20 12:50:40 -04:00
Abhaya Agarwal 9de9c24017 Fixed #24105 -- Called Storage.get_valid_name() when upload_to is callable 2015-05-12 20:08:22 -04:00
Aymeric Augustin 934400759d Guaranteed removal of temporary files during tests.
Dropped the DJANGO_TEST_TEMP_DIR environment variable.

Before this change, proper removal depended on the developer passing
dir=os.environ['DJANGO_TEST_TMP_DIR'] to tempfile functions.
2015-02-23 16:55:26 +01:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
Tim Graham 18f3e79b13 Removed threading fallback imports.
Django imports threading in many other places without fallback.
2015-01-28 10:23:25 -05:00