|
13 | 13 | import docx |
14 | 14 |
|
15 | 15 | from docx.api import Document, DocumentNew |
16 | | -from docx.enum.text import WD_BREAK |
17 | 16 | from docx.opc.constants import CONTENT_TYPE as CT, RELATIONSHIP_TYPE as RT |
18 | 17 | from docx.opc.coreprops import CoreProperties |
19 | 18 | from docx.package import Package |
|
23 | 22 | from docx.shape import InlineShape |
24 | 23 | from docx.styles.styles import Styles |
25 | 24 | from docx.table import Table |
26 | | -from docx.text.paragraph import Paragraph |
27 | 25 | from docx.text.run import Run |
28 | 26 |
|
29 | 27 | from .unitutil.mock import ( |
@@ -92,14 +90,6 @@ def Package_(self, request): |
92 | 90 |
|
93 | 91 | class DescribeDocumentOld(object): |
94 | 92 |
|
95 | | - def it_can_add_a_page_break(self, add_page_break_fixture): |
96 | | - document, document_part_, paragraph_, run_ = add_page_break_fixture |
97 | | - paragraph = document.add_page_break() |
98 | | - document_part_.add_paragraph.assert_called_once_with() |
99 | | - paragraph_.add_run.assert_called_once_with() |
100 | | - run_.add_break.assert_called_once_with(WD_BREAK.PAGE) |
101 | | - assert paragraph is paragraph_ |
102 | | - |
103 | 93 | def it_can_add_a_picture(self, add_picture_fixture): |
104 | 94 | document, image_path_, width, height, run_, picture_ = ( |
105 | 95 | add_picture_fixture |
@@ -177,11 +167,6 @@ def it_creates_numbering_part_on_first_access_if_not_present( |
177 | 167 |
|
178 | 168 | # fixtures ------------------------------------------------------- |
179 | 169 |
|
180 | | - @pytest.fixture |
181 | | - def add_page_break_fixture( |
182 | | - self, document, document_part_, paragraph_, run_): |
183 | | - return document, document_part_, paragraph_, run_ |
184 | | - |
185 | 170 | @pytest.fixture |
186 | 171 | def add_picture_fixture(self, request, run_, picture_): |
187 | 172 | document = Document() |
@@ -255,13 +240,10 @@ def document_obj_(self, request): |
255 | 240 | return instance_mock(request, docx.document.Document) |
256 | 241 |
|
257 | 242 | @pytest.fixture |
258 | | - def document_part_( |
259 | | - self, request, paragraph_, paragraphs_, section_, table_, |
260 | | - tables_): |
| 243 | + def document_part_(self, request, paragraphs_, section_, table_, tables_): |
261 | 244 | document_part_ = instance_mock( |
262 | 245 | request, DocumentPart, content_type=CT.WML_DOCUMENT_MAIN |
263 | 246 | ) |
264 | | - document_part_.add_paragraph.return_value = paragraph_ |
265 | 247 | document_part_.add_section.return_value = section_ |
266 | 248 | document_part_.add_table.return_value = table_ |
267 | 249 | document_part_.paragraphs = paragraphs_ |
@@ -309,12 +291,6 @@ def package_(self, request, document_part_): |
309 | 291 | package_.main_document_part = document_part_ |
310 | 292 | return package_ |
311 | 293 |
|
312 | | - @pytest.fixture |
313 | | - def paragraph_(self, request, run_): |
314 | | - paragraph_ = instance_mock(request, Paragraph) |
315 | | - paragraph_.add_run.return_value = run_ |
316 | | - return paragraph_ |
317 | | - |
318 | 294 | @pytest.fixture |
319 | 295 | def paragraphs_(self, request): |
320 | 296 | return instance_mock(request, list) |
|
0 commit comments