示例#1
0
 def test_tgettext(self):
     rv = to_fragment(
         tgettext('Back to %(parent)s',
                  parent=tag.a('WikiStart', href='http://localhost/')))
     self.assertEqual(Fragment, type(rv))
     self.assertEqual('Back to <a href="http://localhost/">WikiStart</a>',
                      unicode(rv))
示例#2
0
文件: html.py 项目: pkdevbox/trac
 def test_tgettext(self):
     rv = to_fragment(tgettext('Back to %(parent)s',
                               parent=tag.a('WikiStart',
                                            href='http://localhost/')))
     self.assertEqual(Fragment, type(rv))
     self.assertEqual('Back to <a href="http://localhost/">WikiStart</a>',
                      unicode(rv))
示例#3
0
 def test_tracerror_with_tgettext(self):
     e = TracError(
         tgettext('Back to %(parent)s',
                  parent=tag.a('WikiStart', href='http://localhost/')))
     rv = to_fragment(e)
     self.assertEqual(Fragment, type(rv))
     self.assertEqual('Back to <a href="http://localhost/">WikiStart</a>',
                      str(rv))