Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)