diff options
Diffstat (limited to 'tests/staticfiles_tests')
| -rw-r--r-- | tests/staticfiles_tests/project/documents/cached/data_uri_with_nested_url.css | 3 | ||||
| -rw-r--r-- | tests/staticfiles_tests/test_storage.py | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/staticfiles_tests/project/documents/cached/data_uri_with_nested_url.css b/tests/staticfiles_tests/project/documents/cached/data_uri_with_nested_url.css new file mode 100644 index 0000000000..86e64e9498 --- /dev/null +++ b/tests/staticfiles_tests/project/documents/cached/data_uri_with_nested_url.css @@ -0,0 +1,3 @@ +#example { + background-image: url("data:image/svg+xml,url(%23b) url(%23c)"); +} diff --git a/tests/staticfiles_tests/test_storage.py b/tests/staticfiles_tests/test_storage.py index 9ca4d62553..35799f0ff7 100644 --- a/tests/staticfiles_tests/test_storage.py +++ b/tests/staticfiles_tests/test_storage.py @@ -235,6 +235,13 @@ class TestHashedFiles: self.assertIn(b"other.d41d8cd98f00.css", content) self.assertPostCondition() + def test_css_data_uri_with_nested_url(self): + relpath = self.hashed_file_path("cached/data_uri_with_nested_url.css") + with storage.staticfiles_storage.open(relpath) as relfile: + content = relfile.read() + self.assertIn(b'url("data:image/svg+xml,url(%23b) url(%23c)")', 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") |
