aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJannis Leidel2013-12-23 12:43:49 +0100
committerJannis Leidel2013-12-23 12:43:49 +0100
commit4225671177f9f65e873ddbab373e5968c2afa8fc (patch)
tree7c7b8f5280ed84d49af311a56e1039706ce9029a /tests
parent9298aff6ed93cd2463730f31c1576bf9e396084e (diff)
downloaddjango-debug-toolbar-4225671177f9f65e873ddbab373e5968c2afa8fc.tar.bz2
Fix staticfiles panel to work with prefixed STATICFILES_DIRS.
Closes #503 and #507. Many thanks to Alexander Clausen (@sk1p) for the inspiration for the patch.
Diffstat (limited to 'tests')
-rw-r--r--tests/panels/test_staticfiles.py6
-rw-r--r--tests/settings.py6
2 files changed, 7 insertions, 5 deletions
diff --git a/tests/panels/test_staticfiles.py b/tests/panels/test_staticfiles.py
index 70a7b96..be4f267 100644
--- a/tests/panels/test_staticfiles.py
+++ b/tests/panels/test_staticfiles.py
@@ -2,7 +2,7 @@
from __future__ import absolute_import, unicode_literals
-from django.conf import settings
+from django.contrib.staticfiles import finders
from ..base import BaseTestCase
@@ -19,10 +19,10 @@ class StaticFilesPanelTestCase(BaseTestCase):
self.assertIn('django.contrib.staticfiles.finders.'
'AppDirectoriesFinder', self.panel.content)
self.assertIn('django.contrib.staticfiles.finders.'
- 'FileSystemFinder (1 file)', self.panel.content)
+ 'FileSystemFinder (2 files)', self.panel.content)
self.assertEqual(self.panel.num_used, 0)
self.assertNotEqual(self.panel.num_found, 0)
self.assertEqual(self.panel.get_staticfiles_apps(),
['django.contrib.admin', 'debug_toolbar'])
self.assertEqual(self.panel.get_staticfiles_dirs(),
- settings.STATICFILES_DIRS)
+ finders.FileSystemFinder().locations)
diff --git a/tests/settings.py b/tests/settings.py
index 68346ff..70049b4 100644
--- a/tests/settings.py
+++ b/tests/settings.py
@@ -42,8 +42,10 @@ ROOT_URLCONF = 'tests.urls'
STATIC_URL = '/static/'
-STATICFILES_DIRS = [os.path.join(BASE_DIR, 'tests', 'additional_static')]
-
+STATICFILES_DIRS = [
+ os.path.join(BASE_DIR, 'tests', 'additional_static'),
+ ("prefix", os.path.join(BASE_DIR, 'tests', 'additional_static')),
+]
# Cache and database