diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
| commit | 18e22be138f4d273ce8f63c0ff2c8a437cf6ce5d (patch) | |
| tree | 63bd658de7b6fa0e91d521ca19322dd68bdc1492 /addons/mail/tests/test_mail_gateway.py | |
| parent | f6e5bf847b1a7107c09b009a757823b0f9514fa4 (diff) | |
| parent | 0aab81cd3ac6881b2b64ccedb901b55badd421d4 (diff) | |
[MERGE] forward port of branch 8.0 up to 0aab81c
Diffstat (limited to 'addons/mail/tests/test_mail_gateway.py')
| -rw-r--r-- | addons/mail/tests/test_mail_gateway.py | 12 |
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'}) |
