def testEntry(self): element = fromstring(ENTRY1) d = apptools.parse_atom_entry(".", fromstring(ENTRY1)) d['content'] = "This is text" d['content__type'] = 'text' d['summary'] = "<p>This is text</p>" d['summary__type'] = 'xhtml' apptools.unparse_atom_entry(element, d) new_text = tostring(element) d = apptools.parse_atom_entry(".", fromstring(new_text)) self.assertEqual("This is text", d['content']) self.assertEqual('<html:p xmlns:html="http://www.w3.org/1999/xhtml">This is text</html:p>', d['summary'])
def testSimple(self): res = apptools.parse_atom_entry(".", fromstring(ENTRY1)) self.assertEqual(res['title'], "third") self.assertEqual(res['summary'], "<p>not much</p>") self.assertTrue(res['content'].startswith("""\n <html:p xmlns:html="http://www.w3.org/1999/xhtml">Some stuff</html:p>"""))