diff --git a/addons/test_mail/tests/common.py b/addons/test_mail/tests/common.py index 30ae27a7933eb8457c0e8398a1d2f80640119f61..e536e15fa70896b2694c630b1cf96f523bd5401e 100644 --- a/addons/test_mail/tests/common.py +++ b/addons/test_mail/tests/common.py @@ -180,8 +180,12 @@ class MockEmails(common.SingleTransactionCase): """ Tools method to ease the check of send emails """ expected_email_values = [] for partners in recipients: + if partner_from: + email_from = formataddr((partner_from.name, partner_from.email)) + else: + email_from = values['email_from'] expected = { - 'email_from': formataddr((partner_from.name, partner_from.email)), + 'email_from': email_from, 'email_to': [formataddr((partner.name, partner.email)) for partner in partners] } if 'reply_to' in values: