示例#1
0
文件: test_web.py 项目: daeon/pattern
 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()"
示例#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()"