Пример #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>')