summaryrefslogtreecommitdiff
path: root/addons/test_mail/tests/test_performance.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-10-22 10:01:07 +0000
committerThibault Delavallée <tde@odoo.com>2019-04-03 13:01:27 +0000
commit8160c62a5b42679bcd2648b4a99a8d11251c6bef (patch)
tree768fd3c4fa845886af81b6fa6b78b1b248232a5b /addons/test_mail/tests/test_performance.py
parent1fc047a2a278d8bb2c9ca758c4a31421ce5728f9 (diff)
[IMP] mail: remove inheritance of composer on message
Base issue: unnecessary inherit of composer on mail.message. Indeed there are a lot of unused fields coming from mail.message as well as message specific behavior (notify, check access, various business methods) not relevant for composer. Specifications * remove inherit from mail.message; * re-define used fields; * ensure everything still works; Commit linked to task ID 1907153 and PR #28464 Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Diffstat (limited to 'addons/test_mail/tests/test_performance.py')
-rw-r--r--addons/test_mail/tests/test_performance.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/addons/test_mail/tests/test_performance.py b/addons/test_mail/tests/test_performance.py
index 63c07d53e7d..9030c69c40f 100644
--- a/addons/test_mail/tests/test_performance.py
+++ b/addons/test_mail/tests/test_performance.py
@@ -182,7 +182,7 @@ class TestAdvMailPerformance(TransactionCase):
#voip module read activity_type during create leading to one less query in enterprise on action_feedback
category = activity.activity_type_id.category
- with self.assertQueryCount(__system__=24, emp=47): # com runbot: 24 - 47 // test_mail only: 24 - 45
+ with self.assertQueryCount(__system__=24, emp=41): # com runbot: 24 - 41 // test_mail only: 24 - 39
activity.action_feedback(feedback='Zizisse Done !')
@users('__system__', 'emp')
@@ -199,7 +199,7 @@ class TestAdvMailPerformance(TransactionCase):
record.write({'name': 'Dupe write'})
- with self.assertQueryCount(__system__=26, emp=49): # com runbot: 26 - 49 // test_mail only: 26 - 47
+ with self.assertQueryCount(__system__=26, emp=42): # com runbot: 26 - 42 // test_mail only: 26 - 40
record.action_close('Dupe feedback')
self.assertEqual(record.activity_ids, self.env['mail.activity'])
@@ -416,7 +416,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__=104, emp=139): # com runbot: 101 - 136 // test_mail only: 104 - 136
+ with self.assertQueryCount(__system__=102, emp=126): # com runbot: 99 - 123 // test_mail only: 102 - 123
record.message_post_with_template(template_id, message_type='comment', composition_mode='comment')
self.assertEqual(record.message_ids[0].body, '<p>Adding stuff on %s</p>' % record.name)
@@ -584,7 +584,6 @@ class TestHeavyMailPerformance(TransactionCase):
self.assertEqual(rec.message_ids[1].needaction_partner_ids, self.user_portal.partner_id)
self.assertEqual(len(rec.message_ids), 2)
-
@mute_logger('odoo.tests', 'odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
@users('__system__', 'emp')
@warmup
@@ -601,7 +600,7 @@ class TestHeavyMailPerformance(TransactionCase):
})
self.assertEqual(rec.message_partner_ids, self.partners | self.env.user.partner_id | self.user_portal.partner_id)
- with self.assertQueryCount(__system__=53, emp=74): # test_mail only: 54 - 74
+ with self.assertQueryCount(__system__=51, emp=66): # test_mail only: 51 - 66
rec.write({
'name': 'Test2',
'customer_id': customer_id,
@@ -618,4 +617,3 @@ class TestHeavyMailPerformance(TransactionCase):
self.assertEqual(rec.message_ids[2].subtype_id, self.env.ref('test_mail.st_mail_test_full_umbrella_upd'))
self.assertEqual(rec.message_ids[2].needaction_partner_ids, self.partners | self.user_portal.partner_id)
self.assertEqual(len(rec.message_ids), 3)
-