diff --git a/addons/test_website/tests/test_views_during_module_operation.py b/addons/test_website/tests/test_views_during_module_operation.py index 530284e2645..e960291bf22 100644 --- a/addons/test_website/tests/test_views_during_module_operation.py +++ b/addons/test_website/tests/test_views_during_module_operation.py @@ -62,6 +62,12 @@ class TestViewsDuringModuleOperation(TransactionCase): self.assertTrue(self.env.ref(update_module_view_to_be_t_called.key)) self.assertTrue(self.env.ref(update_module_base_view.key)) + # the upgrade of the module below instanciates a NEW registry, so we + # have to restore the old one in order to perform the cleanups + @self.addCleanup + def cleanup(): + self.registry.registries[self.registry.db_name] = self.registry + # Update the module test_website_module = self.env['ir.module.module'].search([('name', '=', 'test_website')]) test_website_module.button_immediate_upgrade()