diff options
| author | Simon Charette <charette.s@gmail.com> | 2016-05-10 17:45:11 -0400 |
|---|---|---|
| committer | Simon Charette <charette.s@gmail.com> | 2016-05-10 17:48:05 -0400 |
| commit | de22123d3f0eab9495f2f04f972a3bcee7ad1b1c (patch) | |
| tree | 42c24d45a3536e61476446b05d56c88c6f6165fb | |
| parent | 6a67dce9ccbb2533cbb3fb8d16affdf17dd1f8e7 (diff) | |
[1.9.x] Refs #26603 -- Defined lazystr for a template loader test.
Thanks vytisb for the report.
| -rw-r--r-- | tests/template_tests/test_loaders.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/template_tests/test_loaders.py b/tests/template_tests/test_loaders.py index 8cb366e038..e86aebf432 100644 --- a/tests/template_tests/test_loaders.py +++ b/tests/template_tests/test_loaders.py @@ -13,7 +13,8 @@ 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 django.utils.encoding import force_text +from django.utils.functional import lazy from .utils import TEMPLATE_DIR @@ -159,6 +160,7 @@ class CachedLoaderTests(SimpleTestCase): #26603 -- A template name specified as a lazy string should be forced to text before computing its cache key. """ + lazystr = lazy(force_text, six.text_type) self.assertEqual(self.engine.template_loaders[0].cache_key(lazystr('template.html'), []), 'template.html') |
