summaryrefslogtreecommitdiff
path: root/addons/mail/tests/test_mail_gateway.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/tests/test_mail_gateway.py')
-rw-r--r--addons/mail/tests/test_mail_gateway.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/addons/mail/tests/test_mail_gateway.py b/addons/mail/tests/test_mail_gateway.py
index 5de41cc5d7a..cc732b007a2 100644
--- a/addons/mail/tests/test_mail_gateway.py
+++ b/addons/mail/tests/test_mail_gateway.py
@@ -68,7 +68,7 @@ MAIL_TEMPLATE_PLAINTEXT = """Return-Path: <whatever-2a840@postmaster.twitter.com
To: {to}
Received: by mail1.openerp.com (Postfix, from userid 10002)
id 5DF9ABFB2A; Fri, 10 Aug 2012 16:16:39 +0200 (CEST)
-From: Sylvie Lelitre <sylvie.lelitre@agrolait.com>
+From: Sylvie Lelitre <test.sylvie.lelitre@agrolait.com>
Subject: {subject}
MIME-Version: 1.0
Content-Type: text/plain
@@ -525,6 +525,16 @@ class TestMailgateway(TestMail):
self.assertEqual(frog_group.message_ids[0].author_id.id, extra_partner_id,
'message_process: email_from -> author_id wrong')
+ # Do: post a new message with a non-existant email that is a substring of a partner email
+ format_and_process(MAIL_TEMPLATE, email_from='Not really Lombrik Lubrik <oul@email.com>',
+ subject='Re: news (2)',
+ msg_id='<zzzbbbaaaa@agrolait.com>',
+ extra='In-Reply-To: <1198923581.41972151344608186760.JavaMail@agrolait.com>\n')
+ frog_groups = self.mail_group.search(cr, uid, [('name', '=', 'Frogs')])
+ frog_group = self.mail_group.browse(cr, uid, frog_groups[0])
+ # Test: author must not be set, otherwise the system is confusing different users
+ self.assertFalse(frog_group.message_ids[0].author_id, 'message_process: email_from -> mismatching author_id')
+
# Do: post a new message, with a known partner -> duplicate emails -> user
frog_group.message_unsubscribe([extra_partner_id])
self.res_users.write(cr, uid, self.user_raoul_id, {'email': 'test_raoul@email.com'})