|
@@ -212,6 +212,30 @@ class TestHashedFiles:
|
|
|
self.assertIn(b"other.d41d8cd98f00.css", content)
|
|
|
self.assertPostCondition()
|
|
|
|
|
|
+ def test_css_source_map(self):
|
|
|
+ relpath = self.hashed_file_path('cached/source_map.css')
|
|
|
+ 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.assertIn(
|
|
|
+ b'/*# sourceMappingURL=source_map.css.99914b932bd3.map */',
|
|
|
+ content,
|
|
|
+ )
|
|
|
+ self.assertPostCondition()
|
|
|
+
|
|
|
+ def test_css_source_map_sensitive(self):
|
|
|
+ relpath = self.hashed_file_path('cached/source_map_sensitive.css')
|
|
|
+ self.assertEqual(relpath, 'cached/source_map_sensitive.456683f2106f.css')
|
|
|
+ with storage.staticfiles_storage.open(relpath) as relfile:
|
|
|
+ content = relfile.read()
|
|
|
+ self.assertIn(b'/*# sOuRcEMaPpInGURL=source_map.css.map */', content)
|
|
|
+ self.assertNotIn(
|
|
|
+ b'/*# sourceMappingURL=source_map.css.99914b932bd3.map */',
|
|
|
+ content,
|
|
|
+ )
|
|
|
+ self.assertPostCondition()
|
|
|
+
|
|
|
def test_js_source_map(self):
|
|
|
relpath = self.hashed_file_path('cached/source_map.js')
|
|
|
self.assertEqual(relpath, 'cached/source_map.cd45b8534a87.js')
|