summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2012-07-08 18:17:53 +0200
committerJannis Leidel <jannis@leidel.info>2012-07-08 18:17:53 +0200
commit3047981517ffa0c75c97f05446bd0d41865e323b (patch)
treebc55b16c001629fb1577d43c0a9ed2b409341613 /tests
parenteffc2cad95dbf96ee6fd0ac3fd2da18948135d49 (diff)
Fixed #18050 -- Fixed a rather glaring bug in the handling of @import statements when using the cached staticfiles storage.
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/staticfiles_tests/project/documents/cached/import.css1
-rw-r--r--tests/regressiontests/staticfiles_tests/tests.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/regressiontests/staticfiles_tests/project/documents/cached/import.css b/tests/regressiontests/staticfiles_tests/project/documents/cached/import.css
new file mode 100644
index 0000000000..6bc7ce04c4
--- /dev/null
+++ b/tests/regressiontests/staticfiles_tests/project/documents/cached/import.css
@@ -0,0 +1 @@
+@import 'styles.css';
diff --git a/tests/regressiontests/staticfiles_tests/tests.py b/tests/regressiontests/staticfiles_tests/tests.py
index 91435a2c86..9b14c78dc5 100644
--- a/tests/regressiontests/staticfiles_tests/tests.py
+++ b/tests/regressiontests/staticfiles_tests/tests.py
@@ -446,6 +446,13 @@ class TestCollectionCachedStorage(BaseCollectionTestCase,
self.assertIn(b'url("img/relative.acae32e4532b.png")', content)
self.assertIn(b"../cached/styles.93b1147e8552.css", content)
+ def test_import_replacement(self):
+ "See #18050"
+ relpath = self.cached_file_path("cached/import.css")
+ self.assertEqual(relpath, "cached/import.2b1d40b0bbd4.css")
+ with storage.staticfiles_storage.open(relpath) as relfile:
+ self.assertIn(b"""import url("styles.93b1147e8552.css")""", relfile.read())
+
def test_template_tag_deep_relative(self):
relpath = self.cached_file_path("cached/css/window.css")
self.assertEqual(relpath, "cached/css/window.9db38d5169f3.css")