示例#1
0
    def it_adds_to_doc_without_footer(self):
        document = Document(dir_pkg_path)
        document.remove_footers()

        footer = document.add_footer()
        footer_elm_tag = 'w:footerReference'
        sentinel_sectPr = document._body._body.get_or_add_sectPr()
        footer_elms = sentinel_sectPr.findall(qn(footer_elm_tag))
        assert len(footer_elms) == 1

        assert footer
        assert len(footer.paragraphs) == 0

        footer.add_paragraph('foobar')
        assert len(footer.paragraphs) == 1
示例#2
0
    def it_adds_to_doc_without_footer(self):
        document = Document(dir_pkg_path)
        document.remove_footers()

        footer = document.add_footer()
        footer_elm_tag = "w:footerReference"
        sentinel_sectPr = document._body._body.get_or_add_sectPr()
        footer_elms = sentinel_sectPr.findall(qn(footer_elm_tag))
        assert len(footer_elms) == 1

        assert footer
        assert len(footer.paragraphs) == 0

        footer.add_paragraph("foobar")
        assert len(footer.paragraphs) == 1