From ff05de760cc4ef4c7f188e163c722ec3bc1f0cbf Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 20 Jan 2018 23:09:10 -0800 Subject: Fixed #29038 -- Removed closing slash from HTML void tags. --- tests/template_tests/filter_tests/test_linebreaks.py | 16 ++++++++-------- tests/template_tests/filter_tests/test_linebreaksbr.py | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'tests/template_tests') diff --git a/tests/template_tests/filter_tests/test_linebreaks.py b/tests/template_tests/filter_tests/test_linebreaks.py index 0f3cd7a117..8fdb91f377 100644 --- a/tests/template_tests/filter_tests/test_linebreaks.py +++ b/tests/template_tests/filter_tests/test_linebreaks.py @@ -15,12 +15,12 @@ class LinebreaksTests(SimpleTestCase): @setup({'linebreaks01': '{{ a|linebreaks }} {{ b|linebreaks }}'}) def test_linebreaks01(self): output = self.engine.render_to_string('linebreaks01', {"a": "x&\ny", "b": mark_safe("x&\ny")}) - self.assertEqual(output, "

x&
y

x&
y

") + self.assertEqual(output, "

x&
y

x&
y

") @setup({'linebreaks02': '{% autoescape off %}{{ a|linebreaks }} {{ b|linebreaks }}{% endautoescape %}'}) def test_linebreaks02(self): output = self.engine.render_to_string('linebreaks02', {"a": "x&\ny", "b": mark_safe("x&\ny")}) - self.assertEqual(output, "

x&
y

x&
y

") + self.assertEqual(output, "

x&
y

x&
y

") class FunctionTests(SimpleTestCase): @@ -29,13 +29,13 @@ class FunctionTests(SimpleTestCase): self.assertEqual(linebreaks_filter('line 1'), '

line 1

') def test_newline(self): - self.assertEqual(linebreaks_filter('line 1\nline 2'), '

line 1
line 2

') + self.assertEqual(linebreaks_filter('line 1\nline 2'), '

line 1
line 2

') def test_carriage(self): - self.assertEqual(linebreaks_filter('line 1\rline 2'), '

line 1
line 2

') + self.assertEqual(linebreaks_filter('line 1\rline 2'), '

line 1
line 2

') def test_carriage_newline(self): - self.assertEqual(linebreaks_filter('line 1\r\nline 2'), '

line 1
line 2

') + self.assertEqual(linebreaks_filter('line 1\r\nline 2'), '

line 1
line 2

') def test_non_string_input(self): self.assertEqual(linebreaks_filter(123), '

123

') @@ -43,18 +43,18 @@ class FunctionTests(SimpleTestCase): def test_autoescape(self): self.assertEqual( linebreaks_filter('foo\nbar\nbuz'), - '

foo
<a>bar</a>
buz

', + '

foo
<a>bar</a>
buz

', ) def test_autoescape_off(self): self.assertEqual( linebreaks_filter('foo\nbar\nbuz', autoescape=False), - '

foo
bar
buz

', + '

foo
bar
buz

', ) def test_lazy_string_input(self): add_header = lazy(lambda string: 'Header\n\n' + string, str) self.assertEqual( linebreaks_filter(add_header('line 1\r\nline2')), - '

Header

\n\n

line 1
line2

' + '

Header

\n\n

line 1
line2

' ) diff --git a/tests/template_tests/filter_tests/test_linebreaksbr.py b/tests/template_tests/filter_tests/test_linebreaksbr.py index 83a15f97db..f2583f0aaf 100644 --- a/tests/template_tests/filter_tests/test_linebreaksbr.py +++ b/tests/template_tests/filter_tests/test_linebreaksbr.py @@ -14,24 +14,24 @@ class LinebreaksbrTests(SimpleTestCase): @setup({'linebreaksbr01': '{{ a|linebreaksbr }} {{ b|linebreaksbr }}'}) def test_linebreaksbr01(self): output = self.engine.render_to_string('linebreaksbr01', {"a": "x&\ny", "b": mark_safe("x&\ny")}) - self.assertEqual(output, "x&
y x&
y") + self.assertEqual(output, "x&
y x&
y") @setup({'linebreaksbr02': '{% autoescape off %}{{ a|linebreaksbr }} {{ b|linebreaksbr }}{% endautoescape %}'}) def test_linebreaksbr02(self): output = self.engine.render_to_string('linebreaksbr02', {"a": "x&\ny", "b": mark_safe("x&\ny")}) - self.assertEqual(output, "x&
y x&
y") + self.assertEqual(output, "x&
y x&
y") class FunctionTests(SimpleTestCase): def test_newline(self): - self.assertEqual(linebreaksbr('line 1\nline 2'), 'line 1
line 2') + self.assertEqual(linebreaksbr('line 1\nline 2'), 'line 1
line 2') def test_carriage(self): - self.assertEqual(linebreaksbr('line 1\rline 2'), 'line 1
line 2') + self.assertEqual(linebreaksbr('line 1\rline 2'), 'line 1
line 2') def test_carriage_newline(self): - self.assertEqual(linebreaksbr('line 1\r\nline 2'), 'line 1
line 2') + self.assertEqual(linebreaksbr('line 1\r\nline 2'), 'line 1
line 2') def test_non_string_input(self): self.assertEqual(linebreaksbr(123), '123') @@ -39,11 +39,11 @@ class FunctionTests(SimpleTestCase): def test_autoescape(self): self.assertEqual( linebreaksbr('foo\nbar\nbuz'), - 'foo
<a>bar</a>
buz', + 'foo
<a>bar</a>
buz', ) def test_autoescape_off(self): self.assertEqual( linebreaksbr('foo\nbar\nbuz', autoescape=False), - 'foo
bar
buz', + 'foo
bar
buz', ) -- cgit v1.3