MCPcopy
hub / github.com/django/django / test_linebreaks

Method test_linebreaks

tests/utils_tests/test_html.py:101–117  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

99 )
100
101 def test_linebreaks(self):
102 items = (
103 ("para1\n\npara2\r\rpara3", "<p>para1</p>\n\n<p>para2</p>\n\n<p>para3</p>"),
104 (
105 "para1\nsub1\rsub2\n\npara2",
106 "<p>para1<br>sub1<br>sub2</p>\n\n<p>para2</p>",
107 ),
108 (
109 "para1\r\n\r\npara2\rsub1\r\rpara4",
110 "<p>para1</p>\n\n<p>para2<br>sub1</p>\n\n<p>para4</p>",
111 ),
112 ("para1\tmore\n\npara2", "<p>para1\tmore</p>\n\n<p>para2</p>"),
113 )
114 for value, output in items:
115 with self.subTest(value=value, output=output):
116 self.check_output(linebreaks, value, output)
117 self.check_output(linebreaks, lazystr(value), output)
118
119 def test_strip_tags(self):
120 # Python fixed a quadratic-time issue in HTMLParser in 3.13.6, 3.12.12.

Callers

nothing calls this directly

Calls 2

check_outputMethod · 0.95
lazystrFunction · 0.90

Tested by

no test coverage detected