@@ -161,6 +161,63 @@ def it_can_change_whether_the_document_has_distinct_odd_and_even_headers(
161
161
162
162
assert sectPr .xml == expected_xml
163
163
164
+ @pytest .mark .parametrize (
165
+ ("sectPr_cxml" , "footnote_prop_name" , "expected_value" ),
166
+ [
167
+ ("w:sectPr/w:footnotePr/w:numFmt{w:val=decimal}" , "footnote_number_format" , "decimal" ),
168
+ ("w:sectPr/w:footnotePr/w:numFmt{w:val=upperRoman}" , "footnote_number_format" , "upperRoman" ),
169
+ ("w:sectPr/w:footnotePr/w:numFmt{w:val=lowerLetter}" , "footnote_number_format" , "lowerLetter" ),
170
+ ("w:sectPr/w:footnotePr/w:numFmt{w:val=bullet}" , "footnote_number_format" , "bullet" ),
171
+ ("w:sectPr/w:footnotePr/w:pos{w:val=pageBottom}" , "footnote_number_format" , None ),
172
+ ("w:sectPr/w:footnotePr/w:pos{w:val=pageBottom}" , "footnote_position" , "pageBottom" ),
173
+ ("w:sectPr/w:footnotePr/w:numStart{w:val=5}" , "footnote_numbering_start_value" , 5 ),
174
+ ("w:sectPr/w:footnotePr/w:numStart{w:val=13}" , "footnote_numbering_start_value" , 13 ),
175
+ ("w:sectPr/w:footnotePr/w:numRestart{w:val=eachSect}" , "footnote_numbering_restart_location" , "eachSect" ),
176
+ ("w:sectPr/w:footnotePr/w:numRestart{w:val=eachPage}" , "footnote_numbering_restart_location" , "eachPage" ),
177
+ ],
178
+ )
179
+ def it_knows_its_footnote_properties (
180
+ self ,
181
+ sectPr_cxml : str ,
182
+ footnote_prop_name : str ,
183
+ expected_value : str | int | None ,
184
+ document_part_ : Mock ,
185
+ ):
186
+ sectPr = cast (CT_SectPr , element (sectPr_cxml ))
187
+ section = Section (sectPr , document_part_ )
188
+
189
+ value = getattr (section , footnote_prop_name )
190
+
191
+ assert value == expected_value
192
+
193
+ @pytest .mark .parametrize (
194
+ ("sectPr_cxml" , "footnote_prop_name" , "value" , "expected_cxml" ),
195
+ [
196
+ ("w:sectPr" , "footnote_number_format" , "upperRoman" , "w:sectPr/w:footnotePr/w:numFmt{w:val=upperRoman}" ),
197
+ ("w:sectPr/w:footnotePr/w:numFmt{w:val=decimal}" , "footnote_number_format" , "upperRoman" , "w:sectPr/w:footnotePr/w:numFmt{w:val=upperRoman}" ),
198
+ ("w:sectPr" , "footnote_position" , "pageBottom" , "w:sectPr/w:footnotePr/w:pos{w:val=pageBottom}" ),
199
+ ("w:sectPr" , "footnote_numbering_start_value" , 1 , "w:sectPr/w:footnotePr/(w:numStart{w:val=1},w:numRestart{w:val=continuous})" ),
200
+ ("w:sectPr" , "footnote_numbering_start_value" , 5 , "w:sectPr/w:footnotePr/(w:numStart{w:val=5},w:numRestart{w:val=continuous})" ),
201
+ ("w:sectPr" , "footnote_numbering_restart_location" , "eachSect" , "w:sectPr/w:footnotePr/(w:numStart{w:val=1},w:numRestart{w:val=eachSect})" ),
202
+ ("w:sectPr" , "footnote_numbering_restart_location" , "continuous" , "w:sectPr/w:footnotePr/(w:numStart{w:val=1},w:numRestart{w:val=continuous})" ),
203
+ ],
204
+ )
205
+ def it_can_change_its_footnote_properties (
206
+ self ,
207
+ sectPr_cxml : str ,
208
+ footnote_prop_name : str ,
209
+ value : str | int | None ,
210
+ expected_cxml : str ,
211
+ document_part_ : Mock ,
212
+ ):
213
+ sectPr = cast (CT_SectPr , element (sectPr_cxml ))
214
+ expected_xml = xml (expected_cxml )
215
+ section = Section (sectPr , document_part_ )
216
+
217
+ setattr (section , footnote_prop_name , value )
218
+
219
+ assert section ._sectPr .xml == expected_xml
220
+
164
221
def it_provides_access_to_its_even_page_footer (
165
222
self , document_part_ : Mock , _Footer_ : Mock , footer_ : Mock
166
223
):
0 commit comments