summaryrefslogtreecommitdiff
path: root/tests/staticfiles_tests/test_storage.py
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2022-03-03 17:28:57 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-03-04 06:22:28 +0100
commitb811364421c8eea0cf06459462cf1fd58184773b (patch)
tree27903f592999c48f463df6cb8dea34c0dbd412e8 /tests/staticfiles_tests/test_storage.py
parent24cc51f8fb62102a67d16cef1e0748d45afe25f4 (diff)
Refs #33446 -- Allowed variable whitespace in CSS source map references.
Follow up to dc8bb35e39388d41b1f38b6c5d0181224e075f16. The Webpack default is to output CSS source map comments like `/*# sourceMappingURL=main.css.map*/`. Also, Chromium allows tabs.
Diffstat (limited to 'tests/staticfiles_tests/test_storage.py')
-rw-r--r--tests/staticfiles_tests/test_storage.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/staticfiles_tests/test_storage.py b/tests/staticfiles_tests/test_storage.py
index 38c34c3f66..3783d32872 100644
--- a/tests/staticfiles_tests/test_storage.py
+++ b/tests/staticfiles_tests/test_storage.py
@@ -237,7 +237,19 @@ class TestHashedFiles:
self.assertEqual(relpath, "cached/source_map.b2fceaf426aa.css")
with storage.staticfiles_storage.open(relpath) as relfile:
content = relfile.read()
- self.assertNotIn(b"/*# sourceMappingURL=source_map.css.map */", content)
+ self.assertNotIn(b"/*# sourceMappingURL=source_map.css.map*/", content)
+ self.assertIn(
+ b"/*# sourceMappingURL=source_map.css.99914b932bd3.map */",
+ content,
+ )
+ self.assertPostCondition()
+
+ def test_css_source_map_tabs(self):
+ relpath = self.hashed_file_path("cached/source_map_tabs.css")
+ self.assertEqual(relpath, "cached/source_map_tabs.b2fceaf426aa.css")
+ with storage.staticfiles_storage.open(relpath) as relfile:
+ content = relfile.read()
+ self.assertNotIn(b"/*#\tsourceMappingURL=source_map.css.map\t*/", content)
self.assertIn(
b"/*# sourceMappingURL=source_map.css.99914b932bd3.map */",
content,