#23251: Use a temporary folder to store uploaded files during tests
-------------------------------------+-------------------------------------
Reporter: Shai Berger | Owner: Bhavya
| Peshavaria
Type: Bug | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: file storage upload | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Shai Berger):
In the years since this ticket was first filed, cloud services have become
even more pervasive and important than they were. IMO, this means that the
`TEST_MEDIA_ROOT` approach is inferior to a `TEST_FILE_STORAGE`, where the
whole default storage is replaced for tests. That would allow users to
choose if the media in their tests are saved to memory (as suggested in
comment:5), to a different bucket in their cloud object storage, or to a
local file. Of course, if a user explicitly creates their own storage in
code, there's little Django can do as a framework.
Also, I don't think backwards compatibility in the sense of "keep putting
test files into production folders" is something we want here. I'd much
prefer things working properly out of the box -- meaning, the default
should be that media files go into a temporary folder on the local system.
--
Ticket URL: <https://code.djangoproject.com/ticket/23251#comment:18>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701820b33e9eb-35e331c4-b11d-43d6-b82b-9128e4ec7824-000000%40eu-central-1.amazonses.com.