-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] fetchmail_notify_error_to_sender: fix test
- Loading branch information
1 parent
3a2c43a
commit 2b0c6f7
Showing
1 changed file
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): | ||
|
@@ -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), | ||
|
@@ -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), | ||
|
@@ -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([ | ||
|