1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #17455 -- Extended CachedStaticFilesStorage slightly to handle some URLs better that are used to add support for webfonts to IE 6-8. Also ignore data: URLs and fragment-only URLs (e.g. #default#VML).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17282 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-12-27 22:49:24 +00:00
parent ae0ce4373f
commit 46c12d1293
6 changed files with 33 additions and 6 deletions

View File

@@ -331,6 +331,16 @@ class TestCollectionCachedStorage(BaseCollectionTestCase,
self.assertNotIn("cached/other.css", content)
self.assertIn("/static/cached/other.d41d8cd98f00.css", content)
def test_path_with_querystring_and_fragment(self):
relpath = self.cached_file_path("cached/css/fragments.css")
self.assertEqual(relpath, "cached/css/fragments.75433540b096.css")
with storage.staticfiles_storage.open(relpath) as relfile:
content = relfile.read()
self.assertIn('/static/cached/css/fonts/font.a4b0478549d0.eot?#iefix', content)
self.assertIn('/static/cached/css/fonts/font.b8d603e42714.svg#webfontIyfZbseF', content)
self.assertIn('data:font/woff;charset=utf-8;base64,d09GRgABAAAAADJoAA0AAAAAR2QAAQAAAAAAAAAAAAA', content)
self.assertIn('#default#VML', content)
def test_template_tag_absolute(self):
relpath = self.cached_file_path("cached/absolute.css")
self.assertEqual(relpath, "cached/absolute.cc80cb5e2eb1.css")