From 8655b32bb87a62ac37a44bc04c0c146da0deda02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 15 Dec 2017 12:42:02 +0100 Subject: [PATCH] [FIX] mail: fix tracking test with employee, reusing previous record Query count was wrong as the tracking was not performed. --- addons/test_mail/tests/test_performance.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/test_mail/tests/test_performance.py b/addons/test_mail/tests/test_performance.py index 5f6f6d54ec0..4f96de9291c 100644 --- a/addons/test_mail/tests/test_performance.py +++ b/addons/test_mail/tests/test_performance.py @@ -68,8 +68,12 @@ class TestMailPerformance(TransactionCase): @warmup def test_write_mail_with_tracking(self): """ Write records inheriting from 'mail.thread' (with field tracking). """ - record = self.env['test_performance.mail'].search([], limit=1) - self.assertEqual(len(record), 1) + record = self.env['test_performance.mail'].create({ + 'name': 'Test', + 'track': 'Y', + 'value': 40, + 'partner_id': self.env.ref('base.res_partner_12').id, + }) with self.assertQueryCount(admin=20, demo=31): record.track = 'X'