File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88from ..ns import qn
99from ..table import CT_Tbl
1010from ..text import CT_P
11- from ..xmlchemy import BaseOxmlElement
11+ from ..xmlchemy import BaseOxmlElement , ZeroOrOne
1212
1313
1414class CT_Document (BaseOxmlElement ):
1515 """
1616 ``<w:document>`` element, the root element of a document.xml file.
1717 """
18- @property
19- def body (self ):
20- return self .find (qn ('w:body' ))
18+ body = ZeroOrOne ('w:body' )
2119
2220
2321class CT_Body (BaseOxmlElement ):
Original file line number Diff line number Diff line change 44Test suite for the docx.oxml.parts module.
55"""
66
7- from docx .oxml .parts .document import CT_Body
87from docx .oxml .text import CT_P
98
10- from .unitdata .document import a_body , a_document
9+ from .unitdata .document import a_body
1110from ..unitdata .text import a_p , a_sectPr
1211
1312
@@ -52,10 +51,3 @@ def it_can_clear_all_the_content_it_holds(self):
5251 body .clear_content ()
5352 # verify -------------------
5453 assert body .xml == after_body_bldr .xml ()
55-
56-
57- class DescribeCT_Document (object ):
58-
59- def it_holds_a_body_element (self ):
60- document = a_document ().with_nsdecls ().with_child (a_body ()).element
61- assert isinstance (document .body , CT_Body )
You can’t perform that action at this time.
0 commit comments