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:15:45 -0400
commitbd145e7209a0e628cced10384bd6f62d65c0f211 (patch)
tree84da42a2e09f67603e31bd6e4ecb79c8b0b2a5a8 /tests
parent218175b09d244b9c7c84c2f2d5f478297251bbe9 (diff)
Fixed #26536 -- Preserved leading dashes of the cached template loader keys.
Thanks Anders Roos for the report.
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):