summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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):