def test_all(self): """Test if list of strings is escaped well""" tmp_input = ['a<', 'b>', "x'x", 'y"', 'z&z'] output = html_escape(tmp_input) expected_ouput = ['a<', 'b>', 'x'x', 'y"', 'z&z'] self.assertEqual(output, expected_ouput)
def test_amp_expand(self): """Test whether ampersand is not being expanded multiple times""" input_char = ['asd<>&'] output = html_escape(input_char) expected_output = ['asd<>&'] self.assertEqual(output, expected_output)
def test_basic(self): """Basic test with quotation""" input_char = ['asd', '<qwe>', "this 'is' quoted"] output = html_escape(input_char) expected_output = ['asd', '<qwe>', 'this 'is' quoted'] self.assertEqual(output, expected_output)