Ejemplo n.º 1
0
 def test_serialize(self):
     container = self.container
     content_bytes = container.get_part(ODF_CONTENT)
     content_part = XmlPart(ODF_CONTENT, container)
     # differences with lxml
     serialized = content_part.serialize().replace(b"'", b"'")
     self.assertEqual(content_bytes, serialized)
Ejemplo n.º 2
0
 def test_delete(self):
     container = self.container
     content = XmlPart(ODF_CONTENT, container)
     paragraphs = content.get_elements("//text:p")
     for paragraph in paragraphs:
         content.delete_element(paragraph)
     serialized = content.serialize()
     self.assertEqual(serialized.count(b"<text:p"), 0)