[IMP] test_mail: update query counters
After all those changes, query counters can be updated according to latest runbot state. Some counters decreased, meaning simplifying models leads to a performance increase. Hopefully. Or bugs. Or both. LINKS Task ID-2070632 (main task) Task ID-2419762 (followup task) COM PR odoo/odoo#62859 ENT PR odoo/enterprise#15172 UPG PR odoo/upgrade#2005
This commit is contained in:
@@ -271,7 +271,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
|
||||
'partner_ids': [(4, customer_id)],
|
||||
})
|
||||
|
||||
with self.assertQueryCount(__system__=24, emp=31):
|
||||
with self.assertQueryCount(__system__=23, emp=29):
|
||||
composer.send_mail()
|
||||
|
||||
@users('__system__', 'emp')
|
||||
@@ -291,7 +291,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
|
||||
}).create({})
|
||||
composer.onchange_template_id_wrapper()
|
||||
|
||||
with self.assertQueryCount(__system__=32, emp=39):
|
||||
with self.assertQueryCount(__system__=31, emp=37):
|
||||
composer.send_mail()
|
||||
|
||||
# remove created partner to ensure tests are the same each run
|
||||
@@ -312,7 +312,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
|
||||
@warmup
|
||||
def test_message_assignation_inbox(self):
|
||||
record = self.env['mail.test.track'].create({'name': 'Test'})
|
||||
with self.assertQueryCount(__system__=18, emp=21):
|
||||
with self.assertQueryCount(__system__=17, emp=19):
|
||||
record.write({
|
||||
'user_id': self.user_test.id,
|
||||
})
|
||||
@@ -368,7 +368,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
|
||||
def test_message_post_one_inbox_notification(self):
|
||||
record = self.env['mail.test.simple'].create({'name': 'Test'})
|
||||
|
||||
with self.assertQueryCount(__system__=12, emp=17):
|
||||
with self.assertQueryCount(__system__=11, emp=15):
|
||||
record.message_post(
|
||||
body='<p>Test Post Performances with an inbox ping</p>',
|
||||
partner_ids=self.user_test.partner_id.ids,
|
||||
@@ -815,7 +815,7 @@ class TestMailComplexPerformance(BaseMailPerformance):
|
||||
messages.flush()
|
||||
messages.invalidate_cache()
|
||||
|
||||
with self.assertQueryCount(emp=17):
|
||||
with self.assertQueryCount(emp=16):
|
||||
res = messages.message_format()
|
||||
self.assertEqual(len(res), 2)
|
||||
for message in res:
|
||||
@@ -836,14 +836,14 @@ class TestMailComplexPerformance(BaseMailPerformance):
|
||||
'res_id': record.id
|
||||
} for record in records])
|
||||
|
||||
with self.assertQueryCount(emp=5):
|
||||
with self.assertQueryCount(emp=4):
|
||||
res = messages.message_format()
|
||||
self.assertEqual(len(res), 6)
|
||||
|
||||
messages.flush()
|
||||
messages.invalidate_cache()
|
||||
|
||||
with self.assertQueryCount(emp=15):
|
||||
with self.assertQueryCount(emp=12):
|
||||
res = messages.message_format()
|
||||
self.assertEqual(len(res), 6)
|
||||
|
||||
@@ -932,7 +932,7 @@ class TestMailHeavyPerformancePost(BaseMailPerformance):
|
||||
]
|
||||
self.attachements = self.env['ir.attachment'].with_user(self.env.user).create(self.vals)
|
||||
attachement_ids = self.attachements.ids
|
||||
with self.assertQueryCount(emp=78):
|
||||
with self.assertQueryCount(emp=65):
|
||||
self.cr.sql_log = self.warm and self.cr.sql_log_count
|
||||
record.with_context({}).message_post(
|
||||
body='<p>Test body <img src="cid:cid1"> <img src="cid:cid2"></p>',
|
||||
|
||||
Reference in New Issue
Block a user