summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2020-04-07 11:55:28 +0000
committerAdrian Torres <adt@odoo.com>2020-04-08 09:11:24 +0000
commit00c82d3121bc28c4902f8f084d2bb2807350c560 (patch)
tree89298fc8d21b0a7efcee0efc9849dd119d2682ab
parent74f8e8825cac0dbe06cd0f33ea0a114ca6128360 (diff)
[FIX] account: ensure cleanup of registry after test_all_l10n
Followup of #48896, ensures that the registry is correctly cleaned up after the installation of the different l10n_* modules and that the subsequent setup_models is done with the correct registry closes odoo/odoo#49197 X-original-commit: bfd6bdcd89724f04442bbe07307177c523bed5f0 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
-rw-r--r--addons/account/tests/test_account_all_l10n.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/account/tests/test_account_all_l10n.py b/addons/account/tests/test_account_all_l10n.py
index 154c4828268..533dba0f414 100644
--- a/addons/account/tests/test_account_all_l10n.py
+++ b/addons/account/tests/test_account_all_l10n.py
@@ -20,6 +20,13 @@ class TestAllL10n(SingleTransactionCase):
@classmethod
def setUpClass(cls):
super(TestAllL10n, cls).setUpClass()
+
+ # the installation of l10n_* modules below instanciates a NEW registry, so we
+ # have to restore the old one in order to perform the cleanups
+ @cls.addClassCleanup
+ def cleanup():
+ cls.registry.registries[cls.registry.db_name] = cls.registry
+
l10n_mods = cls.env['ir.module.module'].search([
('name', 'like', 'l10n%'),
('state', '=', 'uninstalled'),