Skip to content
Permalink
Browse files

query counts

  • Loading branch information...
Xavier-Do committed Mar 25, 2019
1 parent c130759 commit f3dfd0f282fda118af918ef4aa1edf2aec473e33
Showing with 9 additions and 9 deletions.
  1. +9 −9 addons/test_mail/tests/test_performance.py
@@ -98,7 +98,7 @@ def test_create_mail(self):
@warmup
def test_create_mail_with_tracking(self):
""" Create records inheriting from 'mail.thread' (with field tracking). """
with self.assertQueryCount(__system__=13, demo=13): # test_mail only: 13 - 13
with self.assertQueryCount(__system__=10, demo=13): # test_mail only: 13 - 13
self.env['test_performance.mail'].create({'name': 'X'})

@users('__system__', 'emp')
@@ -182,7 +182,7 @@ def test_adv_activity_full(self):
#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__=26, emp=51): # com runbot: 25 - 46 // test_mail only: 24 - 45
with self.assertQueryCount(__system__=24, emp=46): # com runbot: 25 - 46 // test_mail only: 24 - 45
activity.action_feedback(feedback='Zizisse Done !')

@users('__system__', 'emp')
@@ -199,7 +199,7 @@ def test_adv_activity_mixin(self):

record.write({'name': 'Dupe write'})

with self.assertQueryCount(__system__=28, emp=53): # com runbot: 27 - 86 // test_mail only: 26 - 47
with self.assertQueryCount(__system__=26, emp=48): # com runbot: 27 - 86 // test_mail only: 26 - 47
record.action_close('Dupe feedback')

self.assertEqual(record.activity_ids, self.env['mail.activity'])
@@ -275,7 +275,7 @@ def test_message_post_one_email_notification(self):
def test_message_post_one_inbox_notification(self):
record = self.env['mail.test.simple'].create({'name': 'Test'})

with self.assertQueryCount(__system__=32, emp=46): # com runbot 31 - 45 // test_mail only: 32 - 44
with self.assertQueryCount(__system__=32, emp=44): # com runbot 31 - 45 // test_mail only: 32 - 44
record.message_post(
body='<p>Test Post Performances with an inbox ping</p>',
partner_ids=self.user_test.partner_id.ids,
@@ -485,7 +485,7 @@ def test_complex_tracking_assignation(self):
'user_id': self.env.uid,
})
self.assertEqual(rec.message_partner_ids, self.partners | self.env.user.partner_id)
with self.assertQueryCount(__system__=62, emp=77): # com runbot: 61 - 76 // test_mail only: 60 - 72
with self.assertQueryCount(__system__=60, emp=77): # com runbot: 61 - 76 // 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)
# write tracking message
@@ -505,7 +505,7 @@ def test_complex_tracking_subscription_create(self):
customer_id = self.customer.id
user_id = self.user_portal.id

with self.assertQueryCount(__system__=162, emp=199): # com runbot: 161 - 198 // test_mail only: 161 - 192
with self.assertQueryCount(__system__=154, emp=171): # com runbot: 161 - 198 // test_mail only: 161 - 192
rec = self.env['mail.test.full'].create({
'name': 'Test',
'umbrella_id': umbrella_id,
@@ -532,7 +532,7 @@ def test_complex_tracking_subscription_subtype(self):
})
self.assertEqual(rec.message_partner_ids, self.user_portal.partner_id | self.env.user.partner_id)
self.assertEqual(len(rec.message_ids), 1)
with self.assertQueryCount(__system__=100, emp=122): # com runbot: 99 - 120 // test_mail only: 98 - 116
with self.assertQueryCount(__system__=99, emp=122): # com runbot: 99 - 120 // test_mail only: 98 - 116
rec.write({
'name': 'Test2',
'umbrella_id': self.umbrella.id,
@@ -568,7 +568,7 @@ def test_complex_tracking_subscription_write(self):
})
self.assertEqual(rec.message_partner_ids, self.user_portal.partner_id | self.env.user.partner_id)

with self.assertQueryCount(__system__=106, emp=127): # test_mail only: 105 - 122
with self.assertQueryCount(__system__=104, emp=126): # test_mail only: 105 - 122
rec.write({
'name': 'Test2',
'umbrella_id': umbrella_id,
@@ -601,7 +601,7 @@ def test_complex_tracking_template(self):
})
self.assertEqual(rec.message_partner_ids, self.partners | self.env.user.partner_id | self.user_portal.partner_id)

with self.assertQueryCount(__system__=55, emp=75): # test_mail only: 54 - 74
with self.assertQueryCount(__system__=53, emp=74): # test_mail only: 54 - 74
rec.write({
'name': 'Test2',
'customer_id': customer_id,

0 comments on commit f3dfd0f

Please sign in to comment.
You can’t perform that action at this time.