Pull requests

#12 Merged
Repository
ryankask
Branch
default
Repository
david
Branch
default

HashPathStorage tests deleted my project's static content

Author
  1. Ryan Kaskel
Reviewers
Description

When I inserted "django-storages" in my INSTALLED_APPS, I was surprised that tons of tests were failing. It turns out a django-storage's test removed all my static content!

Luckily everything was easily recoverable because I use version control software; some other poor soul might no be so lucky.

The problem was my MEDIA_ROOT is set to the same directory as all my static content. This probably shouldn't be the case the test blindly removed MEDIA_ROOT and all that lives under it.

My patch uses a subdirectory of MEDIA_ROOT called 'django-storages-test' and removes that instead of MEDIA_ROOT itself.

My commit message should have read "safer" instead of safe as someone could conceivably have a directory 'MEDIA_ROOT/django-storages-test' they don't want to delete.

  • Learn about pull requests

Comments (0)