diff options
| author | Simon Charette <charette.s@gmail.com> | 2016-05-10 09:57:03 -0400 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2016-05-10 10:03:01 -0400 |
| commit | 207c5b4acd410dd39bac31457dae26a0d15b8b93 (patch) | |
| tree | 297e00af836847e5e7a0fed32c396c1eaa2b0e72 /tests/template_tests | |
| parent | bf3057d10bc1e78a8e45142a8288a733b3e908a2 (diff) | |
Fixed #26603 -- Forced lazy template names to text when computing cache key.
Refs #26536.
Thanks Sylvain Fankhauser for the very detailed report.
Diffstat (limited to 'tests/template_tests')
| -rw-r--r-- | tests/template_tests/test_loaders.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/template_tests/test_loaders.py b/tests/template_tests/test_loaders.py index feafeb2b06..8cb366e038 100644 --- a/tests/template_tests/test_loaders.py +++ b/tests/template_tests/test_loaders.py @@ -13,6 +13,7 @@ from django.template.engine import Engine from django.test import SimpleTestCase, ignore_warnings, override_settings from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.functional import lazystr from .utils import TEMPLATE_DIR @@ -153,6 +154,13 @@ class CachedLoaderTests(SimpleTestCase): """ self.assertEqual(self.engine.template_loaders[0].cache_key('-template.html', []), '-template.html') + def test_template_name_lazy_string(self): + """ + #26603 -- A template name specified as a lazy string should be forced + to text before computing its cache key. + """ + self.assertEqual(self.engine.template_loaders[0].cache_key(lazystr('template.html'), []), 'template.html') + @unittest.skipUnless(pkg_resources, 'setuptools is not installed') class EggLoaderTests(SimpleTestCase): |
