示例#1
0
def test_bleach_if_enabled():
    assert tinyblog_bleach(
        '<div class="western">bar</div>'
    ) == 'bar'
示例#2
0
def test_paragraphs_allowed():
    assert tinyblog_bleach(
        '<p class="western">foo</p>'
    ) == '<p>foo</p>'
示例#3
0
def test_no_bleach_if_disabled():
    assert tinyblog_bleach(
        '<div class="western">bar</div>'
    ) == '<div class="western">bar</div>'
示例#4
0
 def bleached_teaser(self):
     return tinyblog_bleach(self.teaser_html)
示例#5
0
def test_links_work():
    assert tinyblog_bleach(
        '<a class="cat" href="bar">foo</a>'
    ) == '<a href="bar">foo</a>'
示例#6
0
def test_overriding_allowed_attributes():
    assert tinyblog_bleach(
        '<p class="western">bar</p>'
    ) == '<p class="western">bar</p>'
示例#7
0
def test_paragraphs_allowed():
    assert tinyblog_bleach('<p class="western">foo</p>') == '<p>foo</p>'
示例#8
0
def test_no_classes():
    assert tinyblog_bleach(
        '<strong class="western">foo</strong>') == '<strong>foo</strong>'
示例#9
0
 def bleached_full_text(self):
     return tinyblog_bleach(self.full_text())
示例#10
0
def test_notags():
    assert tinyblog_bleach('foobar') == 'foobar'
示例#11
0
def test_overriding_allowed_attributes():
    assert tinyblog_bleach(
        '<p class="western">bar</p>') == '<p class="western">bar</p>'
示例#12
0
def test_overriding_allowed_tags():
    assert tinyblog_bleach(
        '<div class="western">bar</div>') == '<div>bar</div>'
示例#13
0
def test_bleach_if_enabled():
    assert tinyblog_bleach('<div class="western">bar</div>') == 'bar'
示例#14
0
def test_no_bleach_if_disabled():
    assert tinyblog_bleach(
        '<div class="western">bar</div>') == '<div class="western">bar</div>'
示例#15
0
def test_notags():
    assert tinyblog_bleach('foobar') == 'foobar'
示例#16
0
 def bleached_teaser(self):
     return tinyblog_bleach(self.teaser_html)
示例#17
0
def test_overriding_allowed_tags():
    assert tinyblog_bleach(
        '<div class="western">bar</div>'
    ) == '<div>bar</div>'
示例#18
0
 def bleached_text(self):
     return tinyblog_bleach(self.text_html)
示例#19
0
def test_no_classes():
    assert tinyblog_bleach(
        '<strong class="western">foo</strong>'
    ) == '<strong>foo</strong>'
示例#20
0
def test_links_work():
    assert tinyblog_bleach(
        '<a class="cat" href="bar">foo</a>') == '<a href="bar">foo</a>'