From e6406853c326ea9210d07766138d2b193c6d1fba Mon Sep 17 00:00:00 2001 From: saeedblanchette Date: Sun, 9 May 2021 05:33:39 +0000 Subject: Refs #24121 -- Added__repr__() to StaticNode. --- tests/template_tests/syntax_tests/test_static.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/template_tests/syntax_tests/test_static.py') 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')", + ) -- cgit v1.3