@@ -92,6 +92,16 @@ def section_(self, request):
9292
9393class DescribeSection (object ):
9494
95+ def it_knows_when_it_displays_a_distinct_first_page_header (
96+ self , diff_first_header_get_fixture
97+ ):
98+ sectPr , expected_value = diff_first_header_get_fixture
99+ section = Section (sectPr , None )
100+
101+ different_first_page_header_footer = section .different_first_page_header_footer
102+
103+ assert different_first_page_header_footer is expected_value
104+
95105 def it_provides_access_to_its_default_footer (
96106 self , document_part_ , _Footer_ , footer_
97107 ):
@@ -198,6 +208,20 @@ def it_can_change_its_page_margins(self, margins_set_fixture):
198208
199209 # fixtures -------------------------------------------------------
200210
211+ @pytest .fixture (
212+ params = [
213+ ("w:sectPr" , False ),
214+ ("w:sectPr/w:titlePg" , True ),
215+ ("w:sectPr/w:titlePg{w:val=0}" , False ),
216+ ("w:sectPr/w:titlePg{w:val=1}" , True ),
217+ ("w:sectPr/w:titlePg{w:val=true}" , True ),
218+ ]
219+ )
220+ def diff_first_header_get_fixture (self , request ):
221+ sectPr_cxml , expected_value = request .param
222+ sectPr = element (sectPr_cxml )
223+ return sectPr , expected_value
224+
201225 @pytest .fixture (params = [
202226 ('w:sectPr/w:pgMar{w:left=120}' , 'left_margin' , 76200 ),
203227 ('w:sectPr/w:pgMar{w:right=240}' , 'right_margin' , 152400 ),
0 commit comments