summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/staticfiles_tests/storage.py5
-rw-r--r--tests/staticfiles_tests/test_storage.py9
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/staticfiles_tests/storage.py b/tests/staticfiles_tests/storage.py
index b9cac3cd05..05fdec8db2 100644
--- a/tests/staticfiles_tests/storage.py
+++ b/tests/staticfiles_tests/storage.py
@@ -88,3 +88,8 @@ class ExtraPatternsStorage(ManifestStaticFilesStorage):
),
),
)
+
+
+class NoneHashStorage(ManifestStaticFilesStorage):
+ def file_hash(self, name, content=None):
+ return None
diff --git a/tests/staticfiles_tests/test_storage.py b/tests/staticfiles_tests/test_storage.py
index c6f6e4fb4e..02704fcbe8 100644
--- a/tests/staticfiles_tests/test_storage.py
+++ b/tests/staticfiles_tests/test_storage.py
@@ -386,6 +386,15 @@ class TestCollectionManifestStorage(TestHashedFiles, CollectionTestCase):
)
+@override_settings(STATICFILES_STORAGE='staticfiles_tests.storage.NoneHashStorage')
+class TestCollectionNoneHashStorage(CollectionTestCase):
+ hashed_file_path = hashed_file_path
+
+ def test_hashed_name(self):
+ relpath = self.hashed_file_path('cached/styles.css')
+ self.assertEqual(relpath, 'cached/styles.css')
+
+
@override_settings(STATICFILES_STORAGE='staticfiles_tests.storage.SimpleStorage')
class TestCollectionSimpleStorage(CollectionTestCase):
hashed_file_path = hashed_file_path