Пример #1
0
 def test():
     edit_script = []
     edit_script = get_edit_script(case.old_html, case.new_html)
     edited_html = html_patch(case.old_html, edit_script)
     assert_html_equal(
         remove_attributes(edited_html),
         remove_attributes(case.new_html),
     )
Пример #2
0
def test_remove_attributes():
    remove_attributes_cases = [
        ('<h1>one</h1>', '<h1>one</h1>'),
        ('<h1 class="test">one</h1>', '<h1>one</h1>'),
        ('<h1 id="test-heading" class="test">one</h1>', '<h1>one</h1>'),
        ('<div>before <h1 id="test-heading" class="test">one</h1> after </div>',
         '<div>before <h1>one</h1> after </div>'),
        (u'<h1 class="test">über</h1>', u'<h1>über</h1>'),
    ]
    for html, stripped_html, in remove_attributes_cases:
        assert_html_equal(remove_attributes(html), stripped_html)
Пример #3
0
def test_remove_attributes():
    remove_attributes_cases = [
        ('<h1>one</h1>',
         '<h1>one</h1>'),
        ('<h1 class="test">one</h1>',
         '<h1>one</h1>'),
        ('<h1 id="test-heading" class="test">one</h1>',
         '<h1>one</h1>'),
        ('<div>before <h1 id="test-heading" class="test">one</h1> after </div>',  # noqa
         '<div>before <h1>one</h1> after </div>'),
        (u'<h1 class="test">über</h1>',
         u'<h1>über</h1>'),
    ]
    for html, stripped_html, in remove_attributes_cases:
        assert_html_equal(remove_attributes(html), stripped_html)