MCPcopy
hub / github.com/django/django / test_textnode_repr

Method test_textnode_repr

tests/template_tests/test_nodelist.py:29–37  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27
28class TextNodeTest(SimpleTestCase):
29 def test_textnode_repr(self):
30 engine = Engine()
31 for temptext, reprtext in [
32 ("Hello, world!", "<TextNode: 'Hello, world!'>"),
33 ("One\ntwo.", "<TextNode: 'One\\ntwo.'>"),
34 ]:
35 template = engine.from_string(temptext)
36 texts = template.nodelist.get_nodes_by_type(TextNode)
37 self.assertEqual(repr(texts[0]), reprtext)
38
39
40class ErrorIndexTest(SimpleTestCase):

Callers

nothing calls this directly

Calls 3

from_stringMethod · 0.95
EngineClass · 0.90
get_nodes_by_typeMethod · 0.45

Tested by

no test coverage detected