[FIX] various: update query counters

According to last runbot.

Part-of: odoo/odoo#130468
This commit is contained in:
Thibault Delavallée
2023-08-02 18:50:18 +02:00
parent 7f83f510e7
commit a4b2ee67a9
3 changed files with 23 additions and 23 deletions
@@ -16,7 +16,7 @@ class SurveyPerformance(common.TestSurveyResultsCommon, HttpCase):
"""
url = f'/survey/results/{self.survey.id}?filters=A,0,{self.gras_id}|L,0,{self.answer_pauline.id}'
self.authenticate('survey_manager', 'survey_manager')
with self.assertQueryCount(default=34): # com 34
with self.assertQueryCount(default=31):
self.url_open(url)
@warmup
@@ -27,12 +27,12 @@ class SurveyPerformance(common.TestSurveyResultsCommon, HttpCase):
"""
url = f'/survey/results/{self.survey.id}?filters=A,0,{self.gras_id}|A,0,{self.cat_id}'
self.authenticate('survey_manager', 'survey_manager')
with self.assertQueryCount(default=32): # com 32
with self.assertQueryCount(default=29):
self.url_open(url)
@warmup
def test_survey_results_with_one_filter(self):
url = f'/survey/results/{self.survey.id}?filters=A,0,{self.cat_id}'
self.authenticate('survey_manager', 'survey_manager')
with self.assertQueryCount(default=32): # com 32
with self.assertQueryCount(default=29):
self.url_open(url)
+18 -18
View File
@@ -356,7 +356,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
'partner_ids': [(4, customer_id)],
})
with self.assertQueryCount(admin=36, employee=36):
with self.assertQueryCount(admin=36, employee=36): # com 35/35
composer._action_send_mail()
@users('admin', 'employee')
@@ -377,7 +377,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
'partner_ids': [(4, customer.id)],
})
with self.assertQueryCount(admin=36, employee=36):
with self.assertQueryCount(admin=36, employee=36): # com 35/35
composer._action_send_mail()
@users('admin', 'employee')
@@ -445,7 +445,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
'partner_ids': [(4, customer_id)],
})
with self.assertQueryCount(admin=36, employee=36):
with self.assertQueryCount(admin=36, employee=36): # com 35/35
composer._action_send_mail()
@users('admin', 'employee')
@@ -455,7 +455,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
test_record, test_template = self._create_test_records()
test_template.write({'attachment_ids': [(5, 0)]})
with self.assertQueryCount(admin=26, employee=26): # tm 15/15 / com 24/24
with self.assertQueryCount(admin=24, employee=24): # tm 15/15 / com 23/23
composer = self.env['mail.compose.message'].with_context({
'default_composition_mode': 'comment',
'default_model': test_record._name,
@@ -463,7 +463,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
'default_template_id': test_template.id,
}).create({})
with self.assertQueryCount(admin=36, employee=36):
with self.assertQueryCount(admin=37, employee=37): # com 36/36
composer._action_send_mail()
# notifications
@@ -479,7 +479,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
def test_mail_composer_w_template_attachments(self):
test_record, test_template = self._create_test_records()
with self.assertQueryCount(admin=26, employee=26): # tm 15/15 / com 24/24
with self.assertQueryCount(admin=24, employee=24): # tm 15/15 / com 23/23
composer = self.env['mail.compose.message'].with_context({
'default_composition_mode': 'comment',
'default_model': test_record._name,
@@ -487,7 +487,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
'default_template_id': test_template.id,
}).create({})
with self.assertQueryCount(admin=43, employee=43):
with self.assertQueryCount(admin=44, employee=44): # com 43/43
composer._action_send_mail()
# notifications
@@ -508,7 +508,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
test_template.write({'attachment_ids': [(5, 0)]})
customer = self.env['res.partner'].browse(self.customer.ids)
with self.assertQueryCount(admin=39, employee=39): # tm 28/28 / com 37/37
with self.assertQueryCount(admin=37, employee=37): # tm 28/28 / com 36/36
composer_form = Form(
self.env['mail.compose.message'].with_context({
'default_composition_mode': 'comment',
@@ -519,7 +519,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
)
composer = composer_form.save()
with self.assertQueryCount(admin=45, employee=45):
with self.assertQueryCount(admin=45, employee=45): # com 44/44
composer._action_send_mail()
# notifications
@@ -538,7 +538,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
test_record, test_template = self._create_test_records()
customer = self.env['res.partner'].browse(self.customer.ids)
with self.assertQueryCount(admin=38, employee=38): # tm 27/27 / com 36/36
with self.assertQueryCount(admin=36, employee=36): # tm 27/27 / com 35/35
composer_form = Form(
self.env['mail.compose.message'].with_context({
'default_composition_mode': 'comment',
@@ -549,7 +549,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
)
composer = composer_form.save()
with self.assertQueryCount(admin=62, employee=62):
with self.assertQueryCount(admin=62, employee=62): # com 61/61
composer._action_send_mail()
# notifications
@@ -585,7 +585,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
@warmup
def test_message_assignation_inbox(self):
record = self.env['mail.test.track'].create({'name': 'Test'})
with self.assertQueryCount(admin=20, employee=20):
with self.assertQueryCount(admin=20, employee=20): # com 19/9
record.write({
'user_id': self.user_test_inbox.id,
})
@@ -659,7 +659,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
def test_message_post_one_email_notification(self):
record = self.env['mail.test.simple'].create({'name': 'Test'})
with self.assertQueryCount(admin=31, employee=31):
with self.assertQueryCount(admin=31, employee=31): # com 30/30
record.message_post(
body=Markup('<p>Test Post Performances with an email ping</p>'),
partner_ids=self.customer.ids,
@@ -671,7 +671,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
def test_message_post_one_inbox_notification(self):
record = self.env['mail.test.simple'].create({'name': 'Test'})
with self.assertQueryCount(admin=19, employee=19):
with self.assertQueryCount(admin=19, employee=19): # com 18/18
record.message_post(
body=Markup('<p>Test Post Performances with an inbox ping</p>'),
partner_ids=self.user_test.partner_id.ids,
@@ -963,7 +963,7 @@ class TestMailComplexPerformance(BaseMailPerformance):
record = self.container.with_user(self.env.user)
# about 20 (19?) queries per additional customer group
with self.assertQueryCount(admin=56, employee=55):
with self.assertQueryCount(admin=56, employee=55): # com 55/54
record.message_post(
body=Markup('<p>Test Post Performances</p>'),
message_type='comment',
@@ -981,7 +981,7 @@ class TestMailComplexPerformance(BaseMailPerformance):
template = self.env.ref('test_mail.mail_test_container_tpl')
# about 20 (19 ?) queries per additional customer group
with self.assertQueryCount(admin=63, employee=62):
with self.assertQueryCount(admin=63, employee=62): # com 62/61
record.message_post_with_source(
template,
message_type='comment',
@@ -1005,7 +1005,7 @@ class TestMailComplexPerformance(BaseMailPerformance):
'default_template_id': test_template.id,
}).create({})
with self.assertQueryCount(admin=151, employee=151):
with self.assertQueryCount(admin=151, employee=151): # com 141/141
messages_as_sudo = test_records.message_post_with_source(
'test_mail.mail_template_simple_test',
render_values={'partner': self.user_test.partner_id},
@@ -1347,7 +1347,7 @@ class TestMailHeavyPerformancePost(BaseMailPerformance):
attachments = self.env['ir.attachment'].with_user(self.env.user).create(self.test_attachments_vals)
# enable_logging = self.cr._enable_logging() if self.warm else nullcontext()
# with self.assertQueryCount(employee=63), enable_logging:
with self.assertQueryCount(employee=61):
with self.assertQueryCount(employee=61): # com 60
record_container.with_context({}).message_post(
body=Markup('<p>Test body <img src="cid:cid1"> <img src="cid:cid2"></p>'),
subject='Test Subject',
@@ -117,7 +117,7 @@ class TestSMSMassPerformance(BaseMailPerformance, sms_common.MockSMS):
'mass_keep_log': False,
})
with self.mockSMSGateway(sms_allow_unlink=True), self.assertQueryCount(employee=56):
with self.mockSMSGateway(sms_allow_unlink=True), self.assertQueryCount(employee=54):
composer.action_send_sms()
@mute_logger('odoo.addons.sms.models.sms_sms')
@@ -133,5 +133,5 @@ class TestSMSMassPerformance(BaseMailPerformance, sms_common.MockSMS):
'mass_keep_log': True,
})
with self.mockSMSGateway(sms_allow_unlink=True), self.assertQueryCount(employee=58):
with self.mockSMSGateway(sms_allow_unlink=True), self.assertQueryCount(employee=57):
composer.action_send_sms()