def test_restore_tags(input): r = Richtypo() r.text = input r.strip_tags() r.restore_tags() assert r.text == input
def test_strip_tags_in_scripts(input, expected): r = Richtypo() r.text = input r.strip_tags() expected = re.sub(r'~(\d+)~', '~([^~]+)~', expected) # it is a regex now expected = re.compile(expected) assert expected.match(r.text)
def test_strip_tags_when_input_already_contains_richtypo_marks(input, expected): r = Richtypo() r.text = input r.strip_tags() r.restore_tags() assert r.text == expected