def test_format_multilined_string_matches_carriage_return_new_line(self): # Given new_line = 'this is on a new\r\nline' # When format_value = format_multilined_string(self.autoescape_context, new_line) self.assertEqual(format_value, 'this is on a new<br>line')
def test_format_multilined_string_auto_escape(self): # Given new_line = '<' # When format_value = format_multilined_string(self.autoescape_context, new_line) self.assertEqual(str(format_value), '<')
def test_format_multilined_string(self): # Given new_line = 'this is\ron a\nnew\r\nline' # When format_value = format_multilined_string(self.autoescape_context, new_line) self.assertEqual(format_value, 'this is<br>on a<br>new<br>line')
def test_format_multilined_string_auto_escape(self): # Given new_line = '<' context = Mock() context.autoescape = True # When format_value = format_multilined_string(context, new_line) self.assertEqual(str(format_value), '<p><</p>')
def test_format_multilined_string(self): # Given new_line = 'this is\ron a\nnew\r\nline' context = Mock() context.autoescape = False # When format_value = format_multilined_string(context, new_line) self.assertEqual(format_value, '<p>this is<br>on a<br>new<br>line</p>')
def test_format_multilined_string_matches_carriage_return_new_line(self): # Given new_line = 'this is on a new\r\nline' context = Mock() context.autoescape = False # When format_value = format_multilined_string(context, new_line) self.assertEqual(format_value, '<p>this is on a new<br>line</p>')