@@ -143,9 +143,11 @@ def test_alt_text_with_brand_text_and_fip_banner_english_shown(renderer):
143143 brand_text = "Example" ,
144144 logo_with_background_colour = True ,
145145 brand_name = "Notify Logo" ,
146+ alt_text_en = "alt_text_en" ,
147+ alt_text_fr = "alt_text_fr" ,
146148 )
147149 )
148- assert 'alt=" "' in email
150+ assert 'alt="alt_text_en / alt_text_fr "' in email
149151 assert 'alt="Notify Logo"' not in email
150152
151153
@@ -159,10 +161,12 @@ def test_alt_text_with_no_brand_text_and_fip_banner_english_shown(renderer):
159161 brand_text = None ,
160162 logo_with_background_colour = True ,
161163 brand_name = "Notify Logo" ,
164+ alt_text_en = "alt_text_en" ,
165+ alt_text_fr = "alt_text_fr" ,
162166 )
163167 )
164168 assert 'alt="Symbol of the Government of Canada / Symbole du gouvernement du Canada"' in email
165- assert 'alt="Notify Logo "' in email
169+ assert 'alt="alt_text_en / alt_text_fr "' in email
166170
167171
168172@pytest .mark .parametrize ("renderer" , [HTMLEmailTemplate , EmailPreviewTemplate ])
@@ -184,15 +188,17 @@ def test_alt_text_with_no_brand_text_and_fip_banner_french_shown(renderer):
184188
185189@pytest .mark .parametrize ("renderer" , [HTMLEmailTemplate , EmailPreviewTemplate ])
186190@pytest .mark .parametrize (
187- "logo_with_background_colour, brand_text, expected_alt_text" ,
191+ "logo_with_background_colour, brand_text, alt_text_en, alt_text_fr, expected_alt_text" ,
188192 [
189- (True , None , 'alt="Notify Logo"' ),
190- (True , "Example" , 'alt=" "' ),
191- (False , "Example" , 'alt=" "' ),
192- (False , None , 'alt="Notify Logo "' ),
193+ (True , None , None , None , 'alt="Notify Logo"' ),
194+ (True , "Example" , "alt_text_en" , "alt_text_fr" , 'alt="alt_text_en / alt_text_fr "' ),
195+ (False , "Example" , None , None , 'alt="Notify Logo "' ),
196+ (False , None , "alt_text_en" , "alt_text_fr" , 'alt="alt_text_en / alt_text_fr "' ),
193197 ],
194198)
195- def test_alt_text_with_no_fip_banner (logo_with_background_colour , brand_text , expected_alt_text , renderer ):
199+ def test_alt_text_with_no_fip_banner (
200+ logo_with_background_colour , brand_text , alt_text_en , alt_text_fr , expected_alt_text , renderer
201+ ):
196202 email = str (
197203 renderer (
198204 {"content" : "hello world" , "subject" : "" },
@@ -201,6 +207,8 @@ def test_alt_text_with_no_fip_banner(logo_with_background_colour, brand_text, ex
201207 brand_text = brand_text ,
202208 logo_with_background_colour = logo_with_background_colour ,
203209 brand_name = "Notify Logo" ,
210+ alt_text_en = alt_text_en ,
211+ alt_text_fr = alt_text_fr ,
204212 )
205213 )
206214
0 commit comments