summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDražen Odobašić <dodobas@quaternion.co>2018-07-31 15:57:11 +0200
committerTim Graham <timograham@gmail.com>2018-07-31 10:11:18 -0400
commit253f1b74daac6300f6670929bfc0540ce1e71f7a (patch)
tree3c7bfcecbf42c260597939bf64f0d7e44d31b339 /tests
parentc26f001967a546165c03f06e19ae2423999fd639 (diff)
[2.0.x] Fixed #29617 -- Fixed Template crash if template_string is lazy.
Regression in 3a148f958dddd97c1379081118c30fbede6b6bc4. Backport of 9f3b9ffd51c71d96728df9ee16f5a57c6f3b315d from master.
Diffstat (limited to 'tests')
-rw-r--r--tests/template_tests/test_base.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/template_tests/test_base.py b/tests/template_tests/test_base.py
index 5320af5e9a..9ab8c4e6c6 100644
--- a/tests/template_tests/test_base.py
+++ b/tests/template_tests/test_base.py
@@ -1,5 +1,12 @@
-from django.template.base import VariableDoesNotExist
+from django.template import Context, Template, VariableDoesNotExist
from django.test import SimpleTestCase
+from django.utils.translation import gettext_lazy
+
+
+class TemplateTests(SimpleTestCase):
+ def test_lazy_template_string(self):
+ template_string = gettext_lazy('lazy string')
+ self.assertEqual(Template(template_string).render(Context()), template_string)
class VariableDoesNotExistTests(SimpleTestCase):