def html_importer(node, zipfile): children = node.getchildren() assert len(children) == 1 and children[0].tag == "html" path = children[0].get("src") body = zipfile.read(path) b = HTMLBlock(html=body) b.save() return b
def test_create_from_dict(self): d = dict(html='foo') tb = HTMLBlock.create_from_dict(d) self.assertEqual(tb.html, 'foo')
def test_add_form(self): f = HTMLBlock.add_form() self.assertTrue('html' in f.fields)