summaryrefslogtreecommitdiff
path: root/tests/staticfiles_tests
diff options
context:
space:
mode:
authorNathan Gaberel <nathan@gnab.fr>2019-05-22 09:07:55 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-06-03 13:11:55 +0200
commitb27c9c953bce3aed205ebc378350ef027ebdd25b (patch)
treeeb1e644c53f814d32e733fcb5be127c17259aa8d /tests/staticfiles_tests
parent34ec52269ade54af31a021b12969913129571a3f (diff)
downloaddjango-b27c9c953bce3aed205ebc378350ef027ebdd25b.tar.gz
Fixed #28604 -- Prevented ManifestStaticFilesStorage from leaving intermediate files.
Diffstat (limited to 'tests/staticfiles_tests')
-rw-r--r--tests/staticfiles_tests/test_storage.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/staticfiles_tests/test_storage.py b/tests/staticfiles_tests/test_storage.py
index 97e3b9113d..51dbf6f4b9 100644
--- a/tests/staticfiles_tests/test_storage.py
+++ b/tests/staticfiles_tests/test_storage.py
@@ -445,6 +445,18 @@ class TestCollectionManifestStorage(TestHashedFiles, CollectionTestCase):
# File exists on disk
self.hashed_file_path(missing_file_name)
+ def test_intermediate_files(self):
+ cached_files = os.listdir(os.path.join(settings.STATIC_ROOT, 'cached'))
+ # Intermediate files shouldn't be created for reference.
+ self.assertEqual(
+ len([
+ cached_file
+ for cached_file in cached_files
+ if cached_file.startswith('relative.')
+ ]),
+ 2,
+ )
+
@override_settings(STATICFILES_STORAGE='staticfiles_tests.storage.SimpleStorage')
class TestCollectionSimpleStorage(CollectionTestCase):