@@ -2836,3 +2836,43 @@ def _post_json(self, url, json_to_post):
28362836 ]:
28372837 self .assertIn (snippet , response ["text" ])
28382838
2839+ # Non-IETF stream: from address uses balloter.formatted_email(), not role_email("ad").
2840+ # Give the balloter a chair role (in a different RG) with a distinct email to prove
2841+ # that chair role address is not used; formatted_email() uses the primary email.
2842+ irtf_doc = RgDraftFactory ()
2843+ non_ad_balloter = PersonFactory (name = "Some Irsgmember" )
2844+ other_rg = GroupFactory (type_id = "rg" )
2845+ chair_role_email = EmailFactory (
2846+ person = non_ad_balloter , address = "chair-role@example.com"
2847+ )
2848+ RoleFactory (
2849+ name_id = "chair" ,
2850+ group = other_rg ,
2851+ person = non_ad_balloter ,
2852+ email = chair_role_email ,
2853+ )
2854+ response = _post_json (
2855+ self ,
2856+ url ,
2857+ {
2858+ "post_data" : {
2859+ "discuss" : "" ,
2860+ "comment" : "cccccc" ,
2861+ "position" : "yes" ,
2862+ "balloter" : non_ad_balloter .pk ,
2863+ "docname" : irtf_doc .name ,
2864+ "cc_choices" : [],
2865+ "additional_cc" : "" ,
2866+ }
2867+ },
2868+ )
2869+ self .assertTrue (response ["success" ])
2870+ from_line = next (
2871+ line for line in response ["text" ].split ("\n " ) if line .startswith ("From: " )
2872+ )
2873+ # formatted_email() uses the primary email, not the chair role email
2874+ self .assertIn (non_ad_balloter .email ().address , from_line )
2875+ self .assertNotIn (chair_role_email .address , from_line )
2876+ for snippet in ["cccccc" , non_ad_balloter .plain_name (), irtf_doc .name ]:
2877+ self .assertIn (snippet , response ["text" ])
2878+
0 commit comments