camptocamp / pytest-odoo

pytest plugin to run Odoo tests
GNU Affero General Public License v3.0
68 stars 45 forks source link

Thread testing flag missing #22

Open simahawk opened 6 years ago

simahawk commented 6 years ago

Odoo code base somewhere relies on threading.currentThread().testing = True

They set it here https://github.com/odoo/odoo/blob/11.0/odoo/modules/module.py#L503 and we tried already to simulate it here https://github.com/camptocamp/pytest-odoo/blob/master/pytest_odoo.py#L84

Still, seems to not work as expected. Use case: partner image default get https://github.com/odoo/odoo/blob/11.0/odoo/addons/base/res/res_partner.py#L282

In this case (our case) we had to create the partner inside the test and not inside test case setup to make it work exactly how it works w/ std odoo tests.