def test_generate_with_children(self): element = Element("div") element.extend(["<foo>", "&"]) element.append_raw("<bar>") assert_equal( [b"<div>", b"<foo>", b"&", b"<bar>", b"</div>"], list(iter(element)))
def test_append_extend(self): element = Element("div") element.append("Hello") element.extend([", ", "World", "!"]) assert_equal(4, len(element)) element.append_raw("Hello") element.extend_raw([", ", "World", "!"]) assert_equal(8, len(element))