Skip to content

Commit

Permalink
[FIX] test_mail: adapt query counts
Browse files Browse the repository at this point in the history
closes #32905

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
  • Loading branch information
rco-odoo committed May 6, 2019
1 parent d0dbcac commit a38dc1c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions addons/test_mail/tests/test_performance.py
Expand Up @@ -210,7 +210,7 @@ def test_adv_activity_mixin(self):
def test_message_assignation_email(self):
self.user_test.write({'notification_type': 'email'})
record = self.env['mail.test.track'].create({'name': 'Test'})
with self.assertQueryCount(__system__=59, emp=74): # com runbot: 59 - 74 // test_mail only: 59 - 71
with self.assertQueryCount(__system__=61, emp=76): # com runbot: 61 - 76 // test_mail only: 61 - 71
record.write({
'user_id': self.user_test.id,
})
Expand Down Expand Up @@ -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__=154, emp=171): # com runbot: 154 - 171 // test_mail only: 154 - 168
with self.assertQueryCount(__system__=155, emp=172): # com runbot: 155 - 172 // test_mail only: 154 - 168
rec = self.env['mail.test.full'].create({
'name': 'Test',
'umbrella_id': umbrella_id,
Expand Down Expand Up @@ -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__=104, emp=126): # test_mail only: 104 - 123
with self.assertQueryCount(__system__=105, emp=127): # test_mail only: 104 - 123
rec.write({
'name': 'Test2',
'umbrella_id': umbrella_id,
Expand Down Expand Up @@ -600,7 +600,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__=51, emp=66): # test_mail only: 51 - 66
with self.assertQueryCount(__system__=52, emp=66): # test_mail only: 51 - 66
rec.write({
'name': 'Test2',
'customer_id': customer_id,
Expand Down
4 changes: 2 additions & 2 deletions addons/test_mass_mailing/tests/test_performance.py
Expand Up @@ -50,7 +50,7 @@ def test_send_mailing(self):
'mailing_domain': [('id', 'in', self.mm_recs.ids)],
})

with self.assertQueryCount(__system__=2480, marketing=3136):
with self.assertQueryCount(__system__=2477, marketing=3128):
mailing.send_mail()

self.assertEqual(mailing.sent, 50)
Expand Down Expand Up @@ -88,7 +88,7 @@ def test_send_mailing_w_bl(self):
'mailing_domain': [('id', 'in', self.mm_recs.ids)],
})

with self.assertQueryCount(__system__=2867, marketing=3619):
with self.assertQueryCount(__system__=2864, marketing=3611):
mailing.send_mail()

self.assertEqual(mailing.sent, 50)
Expand Down
4 changes: 2 additions & 2 deletions odoo/addons/test_performance/tests/test_performance.py
Expand Up @@ -116,7 +116,7 @@ def test_write_base_one2many(self):

# link N lines from rec1 to rec2: O(1) queries
rec1.invalidate_cache()
with self.assertQueryCount(14):
with self.assertQueryCount(13):
rec2.write({'line_ids': [(4, line.id) for line in lines[0]]})
self.assertEqual(rec1.line_ids, lines[1:])
self.assertEqual(rec2.line_ids, lines[0])
Expand Down Expand Up @@ -153,7 +153,7 @@ def test_write_base_one2many(self):

# set N lines in rec2: O(1) queries
rec1.invalidate_cache()
with self.assertQueryCount(15):
with self.assertQueryCount(14):
rec2.write({'line_ids': [(6, 0, lines[0].ids)]})
self.assertEqual(rec1.line_ids, lines[1:])
self.assertEqual(rec2.line_ids, lines[0])
Expand Down

0 comments on commit a38dc1c

Please sign in to comment.