diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-02-09 16:13:08 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-02-09 16:13:08 +0100 |
| commit | 5f3301e5cbbb2c6e7bff732761eef80e8dd5a33d (patch) | |
| tree | 48ab6bd9bbda92dea713c0c52bca3396ef939d82 /addons/test_mail/tests/test_mail_message.py | |
| parent | 715e602bf04ae5a0c9704c599f2145b2808b31b7 (diff) | |
| parent | 20e4cd5bcd1816a478aedd441efa90a34cf63334 (diff) | |
[MERGE] forward port branch 11.0 up to 20e4cd5bcd1
Diffstat (limited to 'addons/test_mail/tests/test_mail_message.py')
| -rw-r--r-- | addons/test_mail/tests/test_mail_message.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/addons/test_mail/tests/test_mail_message.py b/addons/test_mail/tests/test_mail_message.py index 34956afe545..435dc3d9b50 100644 --- a/addons/test_mail/tests/test_mail_message.py +++ b/addons/test_mail/tests/test_mail_message.py @@ -111,6 +111,15 @@ class TestMessageValues(common.BaseFunctionalTest, common.MockEmails): self.assertNotIn('mail.test', msg.message_id) self.assertNotIn('-%d-' % self.alias_record.id, msg.message_id) + def test_mail_message_base64_image(self): + msg = self.env['mail.message'].sudo(self.user_employee).create({ + 'body': 'taratata <img src="data:image/png;base64,iV/+OkI=" width="2"> <img src="data:image/png;base64,iV/+OkI=" width="2">', + }) + self.assertEqual(len(msg.attachment_ids), 1) + body = '<p>taratata <img src="/web/image/%s?access_token=%s" alt="image0" width="2"> <img src="/web/image/%s?access_token=%s" alt="image0" width="2"></p>' + body = body % (msg.attachment_ids[0].id, msg.attachment_ids[0].access_token, msg.attachment_ids[0].id, msg.attachment_ids[0].access_token) + self.assertEqual(msg.body, body) + class TestMessageAccess(common.BaseFunctionalTest, common.MockEmails): |
