#23251: Use a temporary folder to store uploaded files during tests
-------------------------------------+------------------------------------
     Reporter:  Shai Berger          |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Testing framework    |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  file storage upload  |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+------------------------------------

Comment (by אורי):

 In Speedy Net I defined `TESTS_MEDIA_ROOT` in settings, which is different
 than the production `MEDIA_ROOT` (it is defined only when running tests).
 All the files in the tests are saved there and it is deleted after the
 tests end. We might want to do something similar in Django for all users,
 and maybe define a default value to `TESTS_MEDIA_ROOT`.

 I also defined a variable `TESTS` in settings, which is True only when
 running tests, and the tests asserts this value to True before running
 tests. This is for not to run tests accidentally with the production or
 other settings, but only with the tests settings. We might want to add a
 similar variable to the settings in Django.

 You can see my commits (from today) in this branch:
 https://github.com/speedy-net/speedy-
 net/commits/uri_main_branch_2019-06-30_a

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23251#comment:13>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.7f20b693568fa84c7b524926545414f6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to