MCPcopy
hub / github.com/django/django / test_conditional_escape

Method test_conditional_escape

tests/utils_tests/test_html.py:372–376  ·  tests/utils_tests/test_html.py::TestUtilsHtml.test_conditional_escape
(self)

Source from the content-addressed store, hash-verified

370 self.assertEqual(smart_urlquote(value), output)
371
372 def test_conditional_escape(self):
373 s = class="st">"<h1>interop</h1>"
374 self.assertEqual(conditional_escape(s), class="st">"&lt;h1&gt;interop&lt;/h1&gt;")
375 self.assertEqual(conditional_escape(mark_safe(s)), s)
376 self.assertEqual(conditional_escape(lazystr(mark_safe(s))), s)
377
378 def test_html_safe(self):
379 @html_safe

Callers

nothing calls this directly

Calls 3

conditional_escapeFunction · 0.90
mark_safeFunction · 0.90
lazystrFunction · 0.90

Tested by

no test coverage detected