MCPcopy
hub / github.com/django/django / test_add_str

Method test_add_str

tests/utils_tests/test_safestring.py:125–134  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

123 s.dynamic_attr = True
124
125 def test_add_str(self):
126 s = SafeString("a&b")
127 cases = [
128 ("test", "a&btest"),
129 ("<p>unsafe</p>", "a&amp;b&lt;p&gt;unsafe&lt;/p&gt;"),
130 (SafeString("<p>safe</p>"), SafeString("a&b<p>safe</p>")),
131 ]
132 for case, expected in cases:
133 with self.subTest(case=case):
134 self.assertRenderEqual("{{ s }}", expected, s=s + case)
135
136 def test_add_obj(self):
137

Callers

nothing calls this directly

Calls 2

assertRenderEqualMethod · 0.95
SafeStringClass · 0.90

Tested by

no test coverage detected