summaryrefslogtreecommitdiff
path: root/addons/test_mail
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-02-12 18:34:43 +0100
committerChristophe Simonis <chs@odoo.com>2018-02-12 18:34:43 +0100
commitadeea2a88db4443b2b426877a28bb1471c2f5db1 (patch)
tree2f43fecc9649947d3061e8c482219fa167b3385a /addons/test_mail
parent317f5f11112266128ac2292ecfafcd92cda74fd0 (diff)
parent0f02dcb63918228d48df50f2d5805b7fda25c14a (diff)
[MERGE] forward port branch saas-11.2 up to 0f02dcb6391
Diffstat (limited to 'addons/test_mail')
-rw-r--r--addons/test_mail/tests/test_mail_message.py9
-rw-r--r--addons/test_mail/tests/test_performance.py2
2 files changed, 10 insertions, 1 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):
diff --git a/addons/test_mail/tests/test_performance.py b/addons/test_mail/tests/test_performance.py
index dc47a1f19e6..1dcfb891805 100644
--- a/addons/test_mail/tests/test_performance.py
+++ b/addons/test_mail/tests/test_performance.py
@@ -276,7 +276,7 @@ class TestHeavyMailPerformance(TransactionCase):
customer_id = self.customer.id
user_id = self.user_portal.id
- with self.assertQueryCount(admin=325, emp=388): # test_mail only: 308 - 368
+ with self.assertQueryCount(admin=325, emp=389): # test_mail only: 308 - 368
rec = self.env['mail.test.full'].create({
'name': 'Test',
'umbrella_id': umbrella_id,