Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)