[FIX] test_mail: only patch message_track for test model

This commit is contained in:
Christophe Simonis
2019-02-11 18:35:50 +01:00
parent 8c29df10e0
commit 1738fbb67e
+2 -1
View File
@@ -223,7 +223,8 @@ class TestMailTemplate(BaseFunctionalTest, MockEmails, TestRecipients):
})
def patched_message_track_post_template(*args, **kwargs):
args[0].message_post_with_template(template.id)
if args[0]._name == "mail.test.track":
args[0].message_post_with_template(template.id)
return True
with patch('odoo.addons.mail.models.mail_thread.MailThread._message_track_post_template', patched_message_track_post_template):