summaryrefslogtreecommitdiff
path: root/tests/template_tests
diff options
context:
space:
mode:
authorsaeedblanchette <saiidblanchettel@outlook.com>2021-05-09 05:33:39 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-05-12 08:41:52 +0200
commite6406853c326ea9210d07766138d2b193c6d1fba (patch)
treee2fe74c15b5055ac0c3d3a4c31830d7a60981689 /tests/template_tests
parent34363a391bad5a007f2ab35a6d8c4ece4c3234f6 (diff)
downloaddjango-e6406853c326ea9210d07766138d2b193c6d1fba.tar.gz
Refs #24121 -- Added__repr__() to StaticNode.
Diffstat (limited to 'tests/template_tests')
-rw-r--r--tests/template_tests/syntax_tests/test_static.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/template_tests/syntax_tests/test_static.py b/tests/template_tests/syntax_tests/test_static.py
index 6f4908ac2c..6f27d555bf 100644
--- a/tests/template_tests/syntax_tests/test_static.py
+++ b/tests/template_tests/syntax_tests/test_static.py
@@ -2,6 +2,7 @@ from urllib.parse import urljoin
from django.conf import settings
from django.template import TemplateSyntaxError
+from django.templatetags.static import StaticNode
from django.test import SimpleTestCase, override_settings
from ..utils import setup
@@ -69,3 +70,17 @@ class StaticTagTests(SimpleTestCase):
msg = "'static' takes at least one argument (path to file)"
with self.assertRaisesMessage(TemplateSyntaxError, msg):
self.engine.render_to_string('t')
+
+
+class StaticNodeTests(SimpleTestCase):
+ def test_repr(self):
+ static_node = StaticNode(varname='named-var', path='named-path')
+ self.assertEqual(
+ repr(static_node),
+ "StaticNode(varname='named-var', path='named-path')",
+ )
+ static_node = StaticNode(path='named-path')
+ self.assertEqual(
+ repr(static_node),
+ "StaticNode(varname=None, path='named-path')",
+ )