예제 #1
0
 def testEscape(self):
   self.assertEqual(str(p('Hi & There')), '<p>Hi &amp; There</p>')
   self.assertEqual(str(p(escape('Hi & There'))), '<p>Hi &amp;amp; There</p>')
   self.assertEqual(str(p(unescape('Hi &amp; There'))), '<p>Hi &amp; There</p>')
예제 #2
0
 def testConditionalComment(self):
   self.assertEqual(str(comment(p(), condition='lt IE 7')), '<!--[if lt IE 7]>\n<p></p>\n<![endif]-->')
예제 #3
0
 def testIndentedConditionalComment(self):
   self.assertEqual(str(body(p(), comment(p(), condition='lt IE 7'))), '<body>\n\t<p></p>\n\t<!--[if lt IE 7]>\n\t<p></p>\n\t<![endif]-->\n</body>')
예제 #4
0
 def testIndentedChildren(self):
   self.assertEqual(str(body(p(), p())), '<body>\n\t<p></p>\n\t<p></p>\n</body>')
예제 #5
0
 def testCommentWithTags(self):
   self.assertEqual(str(body(p(), comment(p()))), '<body>\n\t<p></p>\n\t<!--\n\t<p></p>\n\t-->\n</body>')
예제 #6
0
 def testInline(self):
   self.assertEqual(str(p(h1(), __inline=True)), '<p><h1></h1></p>')
예제 #7
0
 def testIndented(self):
   self.assertEqual(str(p(h1())), '<p>\n\t<h1></h1>\n</p>')
예제 #8
0
 def testIndentedConditionalComment(self):
     self.assertEqual(
         str(body(p(), comment(p(), condition='lt IE 7'))),
         '<body>\n\t<p></p>\n\t<!--[if lt IE 7]>\n\t<p></p>\n\t<![endif]-->\n</body>'
     )
예제 #9
0
 def testEscape(self):
     self.assertEqual(str(p('Hi & There')), '<p>Hi &amp; There</p>')
     self.assertEqual(str(p(escape('Hi & There'))),
                      '<p>Hi &amp;amp; There</p>')
     self.assertEqual(str(p(unescape('Hi &amp; There'))),
                      '<p>Hi &amp; There</p>')
예제 #10
0
 def testConditionalComment(self):
     self.assertEqual(str(comment(p(), condition='lt IE 7')),
                      '<!--[if lt IE 7]>\n<p></p>\n<![endif]-->')
예제 #11
0
 def testCommentWithTags(self):
     self.assertEqual(
         str(body(p(), comment(p()))),
         '<body>\n\t<p></p>\n\t<!--\n\t<p></p>\n\t-->\n</body>')
예제 #12
0
 def testIndentedChildren(self):
     self.assertEqual(str(body(p(), p())),
                      '<body>\n\t<p></p>\n\t<p></p>\n</body>')
예제 #13
0
 def testIndented(self):
     self.assertEqual(str(p(h1())), '<p>\n\t<h1></h1>\n</p>')
예제 #14
0
 def testInline(self):
     self.assertEqual(str(p(h1(), __inline=True)), '<p><h1></h1></p>')