From 4225671177f9f65e873ddbab373e5968c2afa8fc Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Dec 2013 12:43:49 +0100 Subject: 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. --- tests/panels/test_staticfiles.py | 6 +++--- tests/settings.py | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3