|
16 | 16 | from docx.opc.coreprops import CoreProperties
|
17 | 17 | from docx.parts.document import DocumentPart
|
18 | 18 | from docx.section import Section, Sections
|
| 19 | +from docx.settings import Settings |
19 | 20 | from docx.shape import InlineShape, InlineShapes
|
20 | 21 | from docx.shared import Length
|
21 | 22 | from docx.styles.styles import Styles
|
@@ -107,6 +108,10 @@ def it_provides_access_to_its_sections(self, sections_fixture):
|
107 | 108 | Sections_.assert_called_once_with(document._element)
|
108 | 109 | assert sections is sections_
|
109 | 110 |
|
| 111 | + def it_provides_access_to_its_settings(self, settings_fixture): |
| 112 | + document, settings_ = settings_fixture |
| 113 | + assert document.settings is settings_ |
| 114 | + |
110 | 115 | def it_provides_access_to_its_styles(self, styles_fixture):
|
111 | 116 | document, styles_ = styles_fixture
|
112 | 117 | assert document.styles is styles_
|
@@ -253,6 +258,12 @@ def sections_fixture(self, Sections_, sections_):
|
253 | 258 | Sections_.return_value = sections_
|
254 | 259 | return document, Sections_, sections_
|
255 | 260 |
|
| 261 | + @pytest.fixture |
| 262 | + def settings_fixture(self, document_part_, settings_): |
| 263 | + document = Document(None, document_part_) |
| 264 | + document_part_.settings = settings_ |
| 265 | + return document, settings_ |
| 266 | + |
256 | 267 | @pytest.fixture
|
257 | 268 | def styles_fixture(self, document_part_, styles_):
|
258 | 269 | document = Document(None, document_part_)
|
@@ -335,6 +346,10 @@ def sections_(self, request):
|
335 | 346 | def sections_prop_(self, request):
|
336 | 347 | return property_mock(request, Document, 'sections')
|
337 | 348 |
|
| 349 | + @pytest.fixture |
| 350 | + def settings_(self, request): |
| 351 | + return instance_mock(request, Settings) |
| 352 | + |
338 | 353 | @pytest.fixture
|
339 | 354 | def styles_(self, request):
|
340 | 355 | return instance_mock(request, Styles)
|
|
0 commit comments