def test_elements_will_all_end_on_close(self): out = HTML() out.start_tag("foo") out.start_tag("bar") out.write_text("baz") out.close() assert str(out) == "<foo><bar>baz</bar></foo>"
def test_void_elements_do_not_need_to_end(self): out = HTML() out.start_tag("foo") out.start_tag("bar") out.write_text("baz") out.start_tag("qux", void=True) out.close() assert str(out) == "<foo><bar>baz<qux></bar></foo>"