def test_widget_base_container_add_child_dispatches_append(): view_test = FakeDispatchView({ 'name': 'append', 'html': '<x id="id">', 'selector': '#id' }) fake_parent = BaseContainer(id='id') fake_parent.view = view_test b_elem = BaseElement(id='id') b_elem.html_tag = 'x' b_elem.autoclosing = True fake_parent.add_child(b_elem) view_test.verify()
def test_widget_base_element_compile_autoclosing(): b_elem = BaseElement(id='a') b_elem.html_tag = "x" b_elem.autoclosing = True assert b_elem.compile() == '<x id="a">'