From 0687f17622c3e93558a80364ff4b07fa1ed76d8e Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 7 Dec 2018 12:20:08 +0000 Subject: [FIX] mail: model description Do not use the model `_description` field which cannot be translated. Use the `display_name` of the corresponding model instead. Moreover, `` gives `'None'`, while `'document'` is expected. This adds a query to some tests, which is expected since `display_name` requires information stored in the DB, while `_description` is defined at the Python level. opw-1908420 --- addons/test_mail/tests/test_performance.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'addons/test_mail/tests/test_performance.py') diff --git a/addons/test_mail/tests/test_performance.py b/addons/test_mail/tests/test_performance.py index 49befe45800..f96a9f0f974 100644 --- a/addons/test_mail/tests/test_performance.py +++ b/addons/test_mail/tests/test_performance.py @@ -265,7 +265,7 @@ class TestAdvMailPerformance(TransactionCase): def test_message_post_one_email_notification(self): record = self.env['mail.test.simple'].create({'name': 'Test'}) - with self.assertQueryCount(__system__=50, emp=70): # com runbot: 47 - 67 // test_mail only: 50 - 67 + with self.assertQueryCount(__system__=51, emp=71): # com runbot: 51 - 71 // test_mail only: 48 - 68 record.message_post( body='

Test Post Performances with an email ping

', partner_ids=self.customer.ids, @@ -401,7 +401,7 @@ class TestHeavyMailPerformance(TransactionCase): self.umbrella.message_subscribe(self.user_portal.partner_id.ids) record = self.umbrella.sudo(self.env.user) - with self.assertQueryCount(__system__=84, emp=107): # com runbot 81 - 104 // test_mail only: 84 - 104 + with self.assertQueryCount(__system__=85, emp=108): # com runbot: 85 - 108 // test_mail only: 81 - 105 record.message_post( body='

Test Post Performances

', message_type='comment', @@ -418,7 +418,7 @@ class TestHeavyMailPerformance(TransactionCase): record = self.umbrella.sudo(self.env.user) template_id = self.env.ref('test_mail.mail_test_tpl').id - with self.assertQueryCount(__system__=103, emp=138): # com runbot 100 - 135 // test_mail only: 103 - 135 + with self.assertQueryCount(__system__=104, emp=139): # com runbot: 104 - 139 // test_mail only: 101 - 136 record.message_post_with_template(template_id, message_type='comment', composition_mode='comment') self.assertEqual(record.message_ids[0].body, '

Adding stuff on %s

' % record.name) @@ -488,7 +488,7 @@ class TestHeavyMailPerformance(TransactionCase): }) self.assertEqual(rec.message_partner_ids, self.partners | self.env.user.partner_id) - with self.assertQueryCount(__system__=60, emp=79): # com runbot: 60 - 75 // test_mail only: 60 - 72 + with self.assertQueryCount(__system__=61, emp=79): # com runbot: 61 - 75 // test_mail only: 60 - 72 rec.write({'user_id': self.user_portal.id}) self.assertEqual(rec.message_partner_ids, self.partners | self.env.user.partner_id | self.user_portal.partner_id) @@ -540,7 +540,7 @@ class TestHeavyMailPerformance(TransactionCase): }) self.assertEqual(rec.message_partner_ids, self.user_portal.partner_id | self.env.user.partner_id) - with self.assertQueryCount(__system__=99, emp=119): # com runbot: 98 - 119 // test_mail only: 98 - 116 + with self.assertQueryCount(__system__=99, emp=120): # com runbot: 98 - 120 // test_mail only: 98 - 116 rec.write({ 'name': 'Test2', 'umbrella_id': self.umbrella.id, @@ -578,7 +578,7 @@ class TestHeavyMailPerformance(TransactionCase): }) self.assertEqual(rec.message_partner_ids, self.user_portal.partner_id | self.env.user.partner_id) - with self.assertQueryCount(__system__=104, emp=126): # test_mail only: 104 - 122 + with self.assertQueryCount(__system__=105, emp=126): # test_mail only: 105 - 126 rec.write({ 'name': 'Test2', 'umbrella_id': umbrella_id, -- cgit v1.2.3