Exemplo n.º 1
0
    def test_document_property_is_a_Document_instance(self):
        factory = WordprocessingDocumentFactory()
        factory.add(MainDocumentPart, '')

        package = create_zip_archive(factory.to_zip_dict())
        # TODO the interface for creating a new WordprocessingDocument sucks
        document = WordprocessingDocument(path=package)
        part = document.main_document_part
        assert isinstance(part.document, Document), part.document
    def test_numbering_property_is_a_Numbering_instance(self):
        factory = WordprocessingDocumentFactory()
        factory.add(NumberingDefinitionsPart, '')
        factory.add(MainDocumentPart, '')

        package = create_zip_archive(factory.to_zip_dict())
        # TODO the interface for creating a new WordprocessingDocument sucks
        document = WordprocessingDocument(path=package)
        part = document.main_document_part.numbering_definitions_part
        assert isinstance(part.numbering, Numbering), part.numbering