def test_add_key_value(): key = "<foo>" value = ">bar<" string = """<ul style="margin: 0px; list-style-position: outside;"> <li style='margin-left:1em; padding-left: 0.5em'>{} = {}</li></ul> """.format(replace_html_symbols(key), replace_html_symbols(value)) assert string == '<ul style="margin: 0px; list-style-position: outside;">\n <li style=\'margin-left:1em; padding-left: 0.5em\'><foo> = >bar<</li></ul>\n '
def test_replace_html_symbols(): assert '<>&' == replace_html_symbols('<>&') assert 'no html symbols' == replace_html_symbols('no html symbols') assert '<mix>' == replace_html_symbols('<mix>')
def test_replace_html_symbols(): assert "<>&" == replace_html_symbols("<>&") assert "no html symbols" == replace_html_symbols("no html symbols") assert "<mix>" == replace_html_symbols("<mix>")