From cf0bf4737f0c5bac4d5bb7e29e3912e2281343be Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Wed, 11 Nov 2020 15:29:12 +0000 Subject: [PATCH] [FIX] test_mail: test that needs to commit the cursor As the test explicitly commits the cursor (this is necessary to release database locks), the teardown phase needs a valid savepoint. --- addons/test_mail/tests/test_mail_mail.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/test_mail/tests/test_mail_mail.py b/addons/test_mail/tests/test_mail_mail.py index 97a6740211d..9af710c910a 100644 --- a/addons/test_mail/tests/test_mail_mail.py +++ b/addons/test_mail/tests/test_mail_mail.py @@ -90,3 +90,7 @@ class TestMailMailRace(common.TransactionCase): mail.unlink() self.partner.unlink() self.env.cr.commit() + + # because we committed the cursor, the savepoint of the test method is + # gone, and this would break TransactionCase cleanups + self.cr.execute('SAVEPOINT test_%d' % self._savepoint_id)