diff options
| author | Tiago Honorato <tiagohonorato1@gmail.com> | 2021-03-12 19:37:47 -0300 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-17 07:49:55 +0100 |
| commit | 4f4f770f77c5d720484c0a71f6a19b9affcc7e28 (patch) | |
| tree | b07f5dba5ec648d7db29040e5604fa9693b7d5dd /tests/template_tests/test_base.py | |
| parent | 065832eaec167a45008aa125887ce1215a1f257d (diff) | |
Refs #24121 -- Added __repr__() to Origin and Template.
Diffstat (limited to 'tests/template_tests/test_base.py')
| -rw-r--r-- | tests/template_tests/test_base.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/template_tests/test_base.py b/tests/template_tests/test_base.py index 475a647dd2..2b206a8968 100644 --- a/tests/template_tests/test_base.py +++ b/tests/template_tests/test_base.py @@ -8,6 +8,17 @@ class TemplateTests(SimpleTestCase): template_string = gettext_lazy('lazy string') self.assertEqual(Template(template_string).render(Context()), template_string) + def test_repr(self): + template = Template( + '<html><body>\n' + '{% if test %}<h1>{{ varvalue }}</h1>{% endif %}' + '</body></html>' + ) + self.assertEqual( + repr(template), + '<Template template_string="<html><body>{% if t...">', + ) + class VariableDoesNotExistTests(SimpleTestCase): def test_str(self): |
