Skip to content

Commit

Permalink
[FIX] fetchmail_notify_error_to_sender: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
MiquelRForgeFlow committed Mar 12, 2019
1 parent 3a2c43a commit 2b0c6f7
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


import socket
from odoo.addons.test_mail.data.test_mail_data import MAIL_TEMPLATE
from odoo.addons.test_mail.tests.test_mail_gateway import TestMailgateway
from odoo.tools import mute_logger
from email.utils import formataddr


class TestFetchmailNotifyErrorToSender(TestMailgateway):
Expand All @@ -28,7 +28,7 @@ def format_and_process_with_context(
cc_email='',
msg_id='<[email protected]>',
model=None, target_model='mail.test.simple', target_field='name',
ctx=None
ctx=None,
):
self.assertFalse(self.env[target_model].search([
(target_field, '=', subject),
Expand All @@ -49,7 +49,7 @@ def format_and_process_with_context(

@mute_logger('odoo.addons.mail.models.mail_thread', 'odoo.models')
def test_message_process(self):
email_from = '[email protected]'
email_from = formataddr((self.partner_1.name, self.partner_1.email))

count_return_mails_before = self.env['mail.mail'].search_count([
('email_to', '=', email_from),
Expand All @@ -61,13 +61,13 @@ def test_message_process(self):
email_from=email_from,
to_email='[email protected]',
subject='spam',
extra='In-Reply-To: <12321321-openerp-%d-mail.test@%s>' % (
self.test_record.id,
socket.gethostname(),
),
extra='In-Reply-To: <12321321-openerp-%d-mail.test.simple@%s'
'>' % (self.test_record.id,
socket.gethostname(),
),
ctx={
'fetchmail_server_id': self.fetchmail_server.id,
}
}
)

count_return_mails_after = self.env['mail.mail'].search_count([
Expand Down

0 comments on commit 2b0c6f7

Please sign in to comment.