summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2016-04-24 15:28:12 -0400
committerSimon Charette <charette.s@gmail.com>2016-04-24 22:17:36 -0400
commita06fa6e7d35b408264ee0c2e19d2040ef54c5b4d (patch)
tree53a38194f5d657c853f6aaf08a652f83c2777d75 /tests
parent7426c8fd82393404f1885606a646fda764b1e182 (diff)
[1.9.x] Fixed #26536 -- Preserved leading dashes of the cached template loader keys.
Thanks Anders Roos for the report. Backport of bd145e7209a0e628cced10384bd6f62d65c0f211 from master
Diffstat (limited to 'tests')
-rw-r--r--tests/template_tests/test_loaders.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/template_tests/test_loaders.py b/tests/template_tests/test_loaders.py
index 35921e0472..feafeb2b06 100644
--- a/tests/template_tests/test_loaders.py
+++ b/tests/template_tests/test_loaders.py
@@ -146,6 +146,13 @@ class CachedLoaderTests(SimpleTestCase):
# The two templates should not have the same content
self.assertNotEqual(t1.render(Context({})), t2.render(Context({})))
+ def test_template_name_leading_dash_caching(self):
+ """
+ #26536 -- A leading dash in a template name shouldn't be stripped
+ from its cache key.
+ """
+ self.assertEqual(self.engine.template_loaders[0].cache_key('-template.html', []), '-template.html')
+
@unittest.skipUnless(pkg_resources, 'setuptools is not installed')
class EggLoaderTests(SimpleTestCase):