Odoo Test Helper is a Python library providing a toolbox for writing Odoo tests, primarily by facilitating the loading of fake models. This is particularly useful for testing abstract Odoo modules where real record interaction is needed without actual database persistence. Maintained by the Odoo Community Association (OCA), the library is currently at version 2.1.3 and has an infrequent, as-needed release cadence.
pip install odoo-test-helperVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up and use a fake Odoo model within a test case. It shows the correct placement for importing fake models (after `backup_registry`) and how to clean up the registry afterwards.
For Odoo 19+, migrate to native Odoo testing mechanisms. Refer to Odoo's official documentation and OCA migration guides for equivalent native patterns.
Exercise caution when using in production-critical test suites. Monitor the GitHub repository for updates and be prepared for potential API changes. Consider pinning to a specific version.
Always ensure that `from .models import YourFakeModel` statements for test-specific models are placed after `cls.loader.backup_registry()` to correctly manage the Odoo registry context.