summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/test/signals.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/django/test/signals.py b/django/test/signals.py
index 6888753b06..56a8945e01 100644
--- a/django/test/signals.py
+++ b/django/test/signals.py
@@ -156,3 +156,24 @@ def root_urlconf_changed(**kwargs):
from django.core.urlresolvers import clear_url_caches, set_urlconf
clear_url_caches()
set_urlconf(None)
+
+
+@receiver(setting_changed)
+def static_storage_changed(**kwargs):
+ if kwargs['setting'] in {
+ 'STATICFILES_STORAGE',
+ 'STATIC_ROOT',
+ 'STATIC_URL',
+ }:
+ from django.contrib.staticfiles.storage import staticfiles_storage
+ staticfiles_storage._wrapped = empty
+
+
+@receiver(setting_changed)
+def static_finders_changed(**kwargs):
+ if kwargs['setting'] in {
+ 'STATICFILES_DIRS',
+ 'STATIC_ROOT',
+ }:
+ from django.contrib.staticfiles.finders import get_finder
+ get_finder.cache_clear()