summaryrefslogtreecommitdiff
path: root/tests/template_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template_tests')
-rw-r--r--tests/template_tests/filter_tests/test_linebreaks.py16
-rw-r--r--tests/template_tests/filter_tests/test_linebreaksbr.py14
2 files changed, 15 insertions, 15 deletions
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, "<p>x&amp;<br />y</p> <p>x&<br />y</p>")
+ self.assertEqual(output, "<p>x&amp;<br>y</p> <p>x&<br>y</p>")
@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, "<p>x&<br />y</p> <p>x&<br />y</p>")
+ self.assertEqual(output, "<p>x&<br>y</p> <p>x&<br>y</p>")
class FunctionTests(SimpleTestCase):
@@ -29,13 +29,13 @@ class FunctionTests(SimpleTestCase):
self.assertEqual(linebreaks_filter('line 1'), '<p>line 1</p>')
def test_newline(self):
- self.assertEqual(linebreaks_filter('line 1\nline 2'), '<p>line 1<br />line 2</p>')
+ self.assertEqual(linebreaks_filter('line 1\nline 2'), '<p>line 1<br>line 2</p>')
def test_carriage(self):
- self.assertEqual(linebreaks_filter('line 1\rline 2'), '<p>line 1<br />line 2</p>')
+ self.assertEqual(linebreaks_filter('line 1\rline 2'), '<p>line 1<br>line 2</p>')
def test_carriage_newline(self):
- self.assertEqual(linebreaks_filter('line 1\r\nline 2'), '<p>line 1<br />line 2</p>')
+ self.assertEqual(linebreaks_filter('line 1\r\nline 2'), '<p>line 1<br>line 2</p>')
def test_non_string_input(self):
self.assertEqual(linebreaks_filter(123), '<p>123</p>')
@@ -43,18 +43,18 @@ class FunctionTests(SimpleTestCase):
def test_autoescape(self):
self.assertEqual(
linebreaks_filter('foo\n<a>bar</a>\nbuz'),
- '<p>foo<br />&lt;a&gt;bar&lt;/a&gt;<br />buz</p>',
+ '<p>foo<br>&lt;a&gt;bar&lt;/a&gt;<br>buz</p>',
)
def test_autoescape_off(self):
self.assertEqual(
linebreaks_filter('foo\n<a>bar</a>\nbuz', autoescape=False),
- '<p>foo<br /><a>bar</a><br />buz</p>',
+ '<p>foo<br><a>bar</a><br>buz</p>',
)
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')),
- '<p>Header</p>\n\n<p>line 1<br />line2</p>'
+ '<p>Header</p>\n\n<p>line 1<br>line2</p>'
)
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&amp;<br />y x&<br />y")
+ self.assertEqual(output, "x&amp;<br>y x&<br>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&<br />y x&<br />y")
+ self.assertEqual(output, "x&<br>y x&<br>y")
class FunctionTests(SimpleTestCase):
def test_newline(self):
- self.assertEqual(linebreaksbr('line 1\nline 2'), 'line 1<br />line 2')
+ self.assertEqual(linebreaksbr('line 1\nline 2'), 'line 1<br>line 2')
def test_carriage(self):
- self.assertEqual(linebreaksbr('line 1\rline 2'), 'line 1<br />line 2')
+ self.assertEqual(linebreaksbr('line 1\rline 2'), 'line 1<br>line 2')
def test_carriage_newline(self):
- self.assertEqual(linebreaksbr('line 1\r\nline 2'), 'line 1<br />line 2')
+ self.assertEqual(linebreaksbr('line 1\r\nline 2'), 'line 1<br>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\n<a>bar</a>\nbuz'),
- 'foo<br />&lt;a&gt;bar&lt;/a&gt;<br />buz',
+ 'foo<br>&lt;a&gt;bar&lt;/a&gt;<br>buz',
)
def test_autoescape_off(self):
self.assertEqual(
linebreaksbr('foo\n<a>bar</a>\nbuz', autoescape=False),
- 'foo<br /><a>bar</a><br />buz',
+ 'foo<br><a>bar</a><br>buz',
)