[FIX] fetchmail_notify_error_to_sender: fix test
parent
60bd49e547
commit
c46159be8b
|
@ -14,6 +14,7 @@
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'depends': [
|
'depends': [
|
||||||
'fetchmail',
|
'fetchmail',
|
||||||
|
'test_mail',
|
||||||
],
|
],
|
||||||
'data': [
|
'data': [
|
||||||
'views/fetchmail_view.xml',
|
'views/fetchmail_view.xml',
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
|
||||||
import socket
|
import socket
|
||||||
from odoo.addons.test_mail.data.test_mail_data import MAIL_TEMPLATE
|
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.addons.test_mail.tests.test_mail_gateway import TestMailgateway
|
||||||
from odoo.tools import mute_logger
|
from odoo.tools import mute_logger
|
||||||
|
from email.utils import formataddr
|
||||||
|
|
||||||
|
|
||||||
class TestFetchmailNotifyErrorToSender(TestMailgateway):
|
class TestFetchmailNotifyErrorToSender(TestMailgateway):
|
||||||
|
@ -28,7 +28,7 @@ class TestFetchmailNotifyErrorToSender(TestMailgateway):
|
||||||
cc_email='',
|
cc_email='',
|
||||||
msg_id='<1198923581.41972151344608186760.JavaMail@agrolait.com>',
|
msg_id='<1198923581.41972151344608186760.JavaMail@agrolait.com>',
|
||||||
model=None, target_model='mail.test.simple', target_field='name',
|
model=None, target_model='mail.test.simple', target_field='name',
|
||||||
ctx=None
|
ctx=None,
|
||||||
):
|
):
|
||||||
self.assertFalse(self.env[target_model].search([
|
self.assertFalse(self.env[target_model].search([
|
||||||
(target_field, '=', subject),
|
(target_field, '=', subject),
|
||||||
|
@ -49,7 +49,7 @@ class TestFetchmailNotifyErrorToSender(TestMailgateway):
|
||||||
|
|
||||||
@mute_logger('odoo.addons.mail.models.mail_thread', 'odoo.models')
|
@mute_logger('odoo.addons.mail.models.mail_thread', 'odoo.models')
|
||||||
def test_message_process(self):
|
def test_message_process(self):
|
||||||
email_from = 'valid.lelitre@agrolait.com'
|
email_from = formataddr((self.partner_1.name, self.partner_1.email))
|
||||||
|
|
||||||
count_return_mails_before = self.env['mail.mail'].search_count([
|
count_return_mails_before = self.env['mail.mail'].search_count([
|
||||||
('email_to', '=', email_from),
|
('email_to', '=', email_from),
|
||||||
|
@ -61,8 +61,8 @@ class TestFetchmailNotifyErrorToSender(TestMailgateway):
|
||||||
email_from=email_from,
|
email_from=email_from,
|
||||||
to_email='noone@example.com',
|
to_email='noone@example.com',
|
||||||
subject='spam',
|
subject='spam',
|
||||||
extra='In-Reply-To: <12321321-openerp-%d-mail.test@%s>' % (
|
extra='In-Reply-To: <12321321-openerp-%d-mail.test.simple@%s'
|
||||||
self.test_record.id,
|
'>' % (self.test_record.id,
|
||||||
socket.gethostname(),
|
socket.gethostname(),
|
||||||
),
|
),
|
||||||
ctx={
|
ctx={
|
||||||
|
|
Loading…
Reference in New Issue