As explained in this question, I'm trying to isolate file-system changes done in Django tests.
I'm basically changing settings.MEDIA_ROOT
before the tests are run. Unfortunately, the Django storage class seems to be unaffected by it, so files are saved in the original location even though MEDIA_ROOT
is pointing to another, temporary, directory.
How do I reinitialized the Django Storage system to reflect the new media root?
UPDATE: The problem is that the settings file is preloaded into a django.conf.Settings
object, and any changes to settings.MEDIA_ROOT
are not reflected in the preloaded instance. I still don't know how to overcome this problem.