|
@@ -12,14 +12,12 @@ from django.contrib.staticfiles.management.commands.collectstatic import \
|
|
|
Command as CollectstaticCommand
|
|
|
from django.core.cache.backends.base import BaseCache
|
|
|
from django.core.management import call_command
|
|
|
-from django.test import SimpleTestCase, override_settings
|
|
|
+from django.test import override_settings
|
|
|
from django.utils import six
|
|
|
from django.utils.encoding import force_text
|
|
|
|
|
|
-from .cases import (
|
|
|
- BaseCollectionTestCase, BaseStaticFilesTestCase, StaticFilesTestCase,
|
|
|
-)
|
|
|
-from .settings import TEST_ROOT, TEST_SETTINGS
|
|
|
+from .cases import CollectionTestCase
|
|
|
+from .settings import TEST_ROOT
|
|
|
|
|
|
|
|
|
def hashed_file_path(test, path):
|
|
@@ -199,14 +197,10 @@ class TestHashedFiles(object):
|
|
|
self.assertEqual("Post-processing 'faulty.css' failed!\n\n", err.getvalue())
|
|
|
|
|
|
|
|
|
-# we set DEBUG to False here since the template tag wouldn't work otherwise
|
|
|
-@override_settings(**dict(
|
|
|
- TEST_SETTINGS,
|
|
|
+@override_settings(
|
|
|
STATICFILES_STORAGE='django.contrib.staticfiles.storage.CachedStaticFilesStorage',
|
|
|
- DEBUG=False,
|
|
|
-))
|
|
|
-class TestCollectionCachedStorage(TestHashedFiles, BaseCollectionTestCase,
|
|
|
- BaseStaticFilesTestCase, SimpleTestCase):
|
|
|
+)
|
|
|
+class TestCollectionCachedStorage(TestHashedFiles, CollectionTestCase):
|
|
|
"""
|
|
|
Tests for the Cache busting storage
|
|
|
"""
|
|
@@ -243,14 +237,10 @@ class TestCollectionCachedStorage(TestHashedFiles, BaseCollectionTestCase,
|
|
|
self.assertEqual(cache_key, 'staticfiles:821ea71ef36f95b3922a77f7364670e7')
|
|
|
|
|
|
|
|
|
-# we set DEBUG to False here since the template tag wouldn't work otherwise
|
|
|
-@override_settings(**dict(
|
|
|
- TEST_SETTINGS,
|
|
|
+@override_settings(
|
|
|
STATICFILES_STORAGE='django.contrib.staticfiles.storage.ManifestStaticFilesStorage',
|
|
|
- DEBUG=False,
|
|
|
-))
|
|
|
-class TestCollectionManifestStorage(TestHashedFiles, BaseCollectionTestCase,
|
|
|
- BaseStaticFilesTestCase, SimpleTestCase):
|
|
|
+)
|
|
|
+class TestCollectionManifestStorage(TestHashedFiles, CollectionTestCase):
|
|
|
"""
|
|
|
Tests for the Cache busting storage
|
|
|
"""
|
|
@@ -321,14 +311,10 @@ class TestCollectionManifestStorage(TestHashedFiles, BaseCollectionTestCase,
|
|
|
self.assertNotIn(cleared_file_name, manifest_content)
|
|
|
|
|
|
|
|
|
-# we set DEBUG to False here since the template tag wouldn't work otherwise
|
|
|
-@override_settings(**dict(
|
|
|
- TEST_SETTINGS,
|
|
|
+@override_settings(
|
|
|
STATICFILES_STORAGE='staticfiles_tests.storage.SimpleCachedStaticFilesStorage',
|
|
|
- DEBUG=False,
|
|
|
-))
|
|
|
-class TestCollectionSimpleCachedStorage(BaseCollectionTestCase,
|
|
|
- BaseStaticFilesTestCase, SimpleTestCase):
|
|
|
+)
|
|
|
+class TestCollectionSimpleCachedStorage(CollectionTestCase):
|
|
|
"""
|
|
|
Tests for the Cache busting storage
|
|
|
"""
|
|
@@ -364,7 +350,7 @@ class CustomStaticFilesStorage(storage.StaticFilesStorage):
|
|
|
|
|
|
|
|
|
@unittest.skipIf(sys.platform.startswith('win'), "Windows only partially supports chmod.")
|
|
|
-class TestStaticFilePermissions(BaseCollectionTestCase, StaticFilesTestCase):
|
|
|
+class TestStaticFilePermissions(CollectionTestCase):
|
|
|
|
|
|
command_params = {
|
|
|
'interactive': False,
|