Ticket #17806: ticket17806_tests.diff

File ticket17806_tests.diff, 1.5 KB (added by lpetre, 3 years ago)

This diff adds some regression tests that demonstrate the bug

  • tests/regressiontests/staticfiles_tests/project/documents/cached/absolute.css

    diff --git a/tests/regressiontests/staticfiles_tests/project/documents/cached/absolute.css b/tests/regressiontests/staticfiles_tests/project/documents/cached/absolute.css
    index e64e7cc..54467a3 100644
    a b  
    11@import url("/static/cached/styles.css");
     2body {
     3    background: #d3d6d8 url(/static/cached/img/relative.png);
     4}
     5 No newline at end of file
  • tests/regressiontests/staticfiles_tests/tests.py

    diff --git a/tests/regressiontests/staticfiles_tests/tests.py b/tests/regressiontests/staticfiles_tests/tests.py
    index 9834885..5aa0f19 100644
    a b class TestCollectionCachedStorage(BaseCollectionTestCase, 
    361361
    362362    def test_template_tag_absolute(self):
    363363        relpath = self.cached_file_path("cached/absolute.css")
    364         self.assertEqual(relpath, "cached/absolute.cc80cb5e2eb1.css")
     364        self.assertEqual(relpath, "cached/absolute.23f087ad823a.css")
    365365        with storage.staticfiles_storage.open(relpath) as relfile:
    366366            content = relfile.read()
    367367            self.assertNotIn("/static/cached/styles.css", content)
    368368            self.assertIn("/static/cached/styles.93b1147e8552.css", content)
     369            self.assertIn('url("/static/cached/img/relative.acae32e4532b.png")', content)
    369370
    370371    def test_template_tag_denorm(self):
    371372        relpath = self.cached_file_path("cached/denorm.css")
Back to Top