From 52f899aae72c261097899d899b6de47c9f8d7c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 12 Sep 2017 10:22:09 +0200 Subject: [PATCH] [FIX] odoo: tests: correctly call super Otherwise inheritance is not always possible because child classes inheriting from the base class are not called. --- odoo/tests/common.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/odoo/tests/common.py b/odoo/tests/common.py index 4d1ddac5c73..4b1245c47e8 100644 --- a/odoo/tests/common.py +++ b/odoo/tests/common.py @@ -172,6 +172,7 @@ class TransactionCase(BaseCase): """ def setUp(self): + super(TransactionCase, self).setUp() self.registry = odoo.registry(get_db_name()) #: current transaction's cursor self.cr = self.cursor() @@ -209,6 +210,7 @@ class SingleTransactionCase(BaseCase): @classmethod def setUpClass(cls): + super(SingleTransactionCase, cls).setUpClass() cls.registry = odoo.registry(get_db_name()) cls.cr = cls.registry.cursor() cls.uid = odoo.SUPERUSER_ID @@ -221,6 +223,7 @@ class SingleTransactionCase(BaseCase): cls.env.reset() cls.cr.rollback() cls.cr.close() + super(SingleTransactionCase, cls).tearDownClass() savepoint_seq = itertools.count() @@ -236,12 +239,15 @@ class SavepointCase(SingleTransactionCase): the test data either. """ def setUp(self): + super(SavepointCase, self).setUp() self._savepoint_id = next(savepoint_seq) self.cr.execute('SAVEPOINT test_%d' % self._savepoint_id) + def tearDown(self): self.cr.execute('ROLLBACK TO SAVEPOINT test_%d' % self._savepoint_id) self.env.clear() self.registry.clear_caches() + super(SavepointCase, self).tearDown() class HttpCase(TransactionCase):