Пример #1
0
 def test_escape_attr_value_with_no_quote(self):
     """ Test the ``escape_attribute_value`` method with a string containing no quote. """
     output = escape_attribute_value('test')
     self.assertEqual('"test"', output)
Пример #2
0
 def test_escape_attr_value_with_double_quote(self):
     """ Test the ``escape_attribute_value`` method with a string containing a double quote. """
     output = escape_attribute_value('test"test')
     self.assertEqual("'test\"test'", output)
Пример #3
0
 def test_escape_attr_value_with_single_and_double_quotes_and_backslash(
         self):
     """ Test the ``escape_attribute_value`` method with a string containing a single and a double quote. """
     output = escape_attribute_value("""test'test\\"test""")
     self.assertEqual('"test\'test\\\\\\"test"', output)
Пример #4
0
 def test_escape_attr_value_with_single_quote(self):
     """ Test the ``escape_attribute_value`` method with a string containing a single quote. """
     output = escape_attribute_value("test'test")
     self.assertEqual('"test\'test"', output)
Пример #5
0
 def test_escape_attr_value_with_no_quote(self):
     """ Test the ``escape_attribute_value`` method with a string containing no quote. """
     output = escape_attribute_value('test')
     self.assertEqual('"test"', output)
Пример #6
0
 def test_escape_attr_value_with_single_and_double_quotes_and_backslash(self):
     """ Test the ``escape_attribute_value`` method with a string containing a single and a double quote. """
     output = escape_attribute_value("""test'test\\"test""")
     self.assertEqual('"test\'test\\\\\\"test"', output)
Пример #7
0
 def test_escape_attr_value_with_double_quote(self):
     """ Test the ``escape_attribute_value`` method with a string containing a double quote. """
     output = escape_attribute_value('test"test')
     self.assertEqual("'test\"test'", output)
Пример #8
0
 def test_escape_attr_value_with_single_quote(self):
     """ Test the ``escape_attribute_value`` method with a string containing a single quote. """
     output = escape_attribute_value("test'test")
     self.assertEqual('"test\'test"', output)