diff --git a/destral/testing.py b/destral/testing.py index a6f870f..5e238d8 100644 --- a/destral/testing.py +++ b/destral/testing.py @@ -46,6 +46,12 @@ def run(self, result, debug=False): self.config['use_template'] ) else: + # In order to install a module, we need to ensure that the + # db and the pool attributes of the openerp object are set. + if self.openerp.db is None: + self.openerp.db = self.openerp.pooler.get_db(self.openerp.db_name) + if self.openerp.pool is None: + self.openerp.pool = self.openerp.pooler.get_pool(self.openerp.db_name) self.drop_database = False result.db_name = self.openerp.db_name self.openerp.install_module(self.config['module'])