def test_stomp_target(self): attrs = { (None, u'href'): u'http://example.com', (None, u'target'): u'foo' } assert (target_blank(attrs) == { (None, u'href'): 'http://example.com', (None, u'target'): u'_blank' })
def test_empty(self): attrs = {} assert target_blank(attrs) == attrs
def test_mailto(self): attrs = {(None, u'href'): u'mailto:[email protected]'} assert target_blank(attrs) == attrs
def test_stomp_target(self): attrs = {(None, u'href'): u'http://example.com', (None, u'target'): u'foo'} assert ( target_blank(attrs) == {(None, u'href'): 'http://example.com', (None, u'target'): u'_blank'} )
def target_blank_except_footnote(attrs, new=False): if "class" in attrs and attrs["class"] == "footnote-backref": return attrs else: return callbacks.target_blank(attrs, new)
def target_blank_except_footnote(attrs, new=False): if "class" in attrs and \ attrs["class"] in ("footnote-backref", "footnote-ref"): return attrs else: return callbacks.target_blank(attrs, new)
def test_add_target(self): attrs = {(None, 'href'): 'http://example.com'} assert (target_blank(attrs) == { (None, 'href'): 'http://example.com', (None, 'target'): '_blank' })
def test_stomp_target(self): attrs = {(None, "href"): "http://example.com", (None, "target"): "foo"} assert target_blank(attrs) == { (None, "href"): "http://example.com", (None, "target"): "_blank", }
def test_mailto(self): attrs = {(None, "href"): "mailto:[email protected]"} assert target_blank(attrs) == attrs
def test_add_target(self): attrs = {(None, 'href'): 'http://example.com'} assert ( target_blank(attrs) == {(None, 'href'): 'http://example.com', (None, 'target'): '_blank'} )