def test__unicode__(self): empty = Tag('em') assert unicode(empty.lower()) == '' assert unicode(empty.capitalize()) == '' assert unicode(empty.add_period()) == '' assert unicode(Tag('strong', u'ねここねこ')) == u'ねここねこ'
def test__str__(self): empty = Tag('em') assert six.text_type(empty.lower()) == '' assert six.text_type(empty.capitalize()) == '' assert six.text_type(empty.add_period()) == '' assert six.text_type(Tag('strong', u'ねここねこ')) == u'ねここねこ'
def test__unicode__(self): empty = Tag('em') assert unicode(empty.lower()) == '' assert unicode(empty.capitalize()) == '' assert unicode(empty.add_period()) == '' assert unicode(Tag('strong', u'ねここねこ')) == u'ねここねこ'
def test_render_as(self): empty = Tag('em') assert empty.render_as('html') == '' assert empty.render_as('latex') == '' tag = Tag('em', 'a', 'b') assert tag.render_as('html') == '<em>ab</em>' assert tag.render_as('latex') == '\\emph{ab}' em = Tag('em', 'Emphasized text') assert em.render_as('latex') == '\\emph{Emphasized text}' assert em.upper().render_as('latex') == '\\emph{EMPHASIZED TEXT}' assert em.lower().render_as('latex') == '\\emph{emphasized text}' assert em.render_as('html') == '<em>Emphasized text</em>' t = Tag(u'em', u'123', Tag(u'em', u'456', Text(u'78'), u'9'), u'0') assert t[:2].render_as('html') == '<em>12</em>' assert t[2:4].render_as('html') == '<em>3<em>4</em></em>' tag = Tag('em', Text(), Text('mary ', 'had ', 'a little lamb')) assert tag.render_as('html') == '<em>mary had a little lamb</em>'
def test_render_as(self): empty = Tag('em') assert empty.render_as('html') == '' assert empty.render_as('latex') == '' tag = Tag('em', 'a', 'b') assert tag.render_as('html') == '<em>ab</em>' assert tag.render_as('latex') == '\\emph{ab}' em = Tag('em', 'Emphasized text') assert em.render_as('latex') == '\\emph{Emphasized text}' assert em.upper().render_as('latex') == '\\emph{EMPHASIZED TEXT}' assert em.lower().render_as('latex') == '\\emph{emphasized text}' assert em.render_as('html') == '<em>Emphasized text</em>' t = Tag(u'em', u'123', Tag(u'em', u'456', Text(u'78'), u'9'), u'0') assert t[:2].render_as('html') == '<em>12</em>' assert t[2:4].render_as('html') == '<em>3<em>4</em></em>' tag = Tag('em', Text(), Text('mary ', 'had ', 'a little lamb')) assert tag.render_as('html') == '<em>mary had a little lamb</em>'
def test_lower(self): tag = Tag('em', Text(), Text('mary ', 'had ', 'a little lamb')) assert tag.lower().render_as('html') == '<em>mary had a little lamb</em>'
def test_lower(self): tag = Tag('em', Text(), Text('mary ', 'had ', 'a little lamb')) assert tag.lower().render_as('html') == '<em>mary had a little lamb</em>'