Esempio n. 1
0
 def test_encode_entities(self):
     # Assert HTML entity encoder (e.g., "&" => "&&")
     for a, b in (
       ("É", "É"), 
       ("&", "&"), 
       ("<", "&lt;"), 
       (">", "&gt;"), 
       ('"', "&quot;"),
       ("'", "&#39;")):
         self.assertEqual(web.encode_entities(a), b)
     print "pattern.web.encode_entities()"
Esempio n. 2
0
 def test_encode_entities(self):
     # Assert HTML entity encoder (e.g., "&" => "&&amp;")
     for a, b in (
       ("&#201;", "&#201;"), 
       ("&", "&amp;"), 
       ("<", "&lt;"), 
       (">", "&gt;"), 
       ('"', "&quot;"),
       ("'", "&#39;")):
         self.assertEqual(web.encode_entities(a), b)
     print "pattern.web.encode_entities()"