odoo-test-helper
Our Odoo project tools
What it is and what it does
odoo-test-helper is a testing utility library for Odoo that simplifies the creation and management of fake test-only models. It solves the problem of testing abstract Odoo modules without needing to create separate test modules or use real production models. The library provides a FakeModelLoader class that handles the complex task of registering temporary models into Odoo's registry during tests and cleanly removing them afterward.
The package is designed for developers writing Odoo module tests who need isolated, test-specific model definitions. It manages the timing and order of model registration to avoid conflicts with Odoo's own model loading process, requiring that fake model imports happen after a backup of the registry is taken. With no external runtime dependencies and active maintenance, it integrates directly into Odoo's SavepointCase test framework.
Use it for:
- Testing abstract Odoo modules by defining minimal fake models that inherit from the abstract base without creating a full test module.
- Isolating unit tests by loading test-only model definitions that don't pollute the production registry.
- Verifying model behavior in connector or search-engine modules that depend on custom model implementations.
- Avoiding the overhead of creating separate test modules when you need temporary model implementations for a single test class.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides utilities for writing Odoo tests, particularly for loading and managing fake test-only models within Odoo's test framework.
Yes, if you are writing tests for Odoo modules. The package solves a real testing problem with low friction and no external dependencies. The Pre-Alpha status and small community (13 stars) suggest caution for mission-critical projects, but active maintenance and real-world use in OCA and Shopinvader projects indicate stability for its intended purpose. LGPLv3+ licensing is standard for OCA projects and poses no barrier to open-source Odoo development.
Install
odoo-test-helper on PyPI
pip
pip install odoo-test-helperuv
uv add odoo-test-helperpoetry
poetry add odoo-test-helperInstalling odoo-test-helper
Before you install
Low installation friction with no runtime dependencies. Active maintenance as of 2026-05-26, though marked Pre-Alpha in development status.
License in practice
Licensed under LGPLv3+, a copyleft license requiring derivative works to be distributed under the same terms; suitable for open-source projects but may constrain proprietary use.
Quickstart
from odoo.tests import SavepointCase
from odoo_test_helper import FakeModelLoader
class MyTest(SavepointCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.loader = FakeModelLoader(cls.env, cls.__module__)
cls.loader.backup_registry()
from .models import FakeModel
cls.loader.update_registry((FakeModel,))
@classmethod
def tearDownClass(cls):
cls.loader.restore_registry()
super().tearDownClass()
Requires Odoo framework and Python 3.8+; fake model classes must be imported after backup_registry() is called to avoid registration conflicts.
Verify before relying
- Whether the package works with all current Odoo versions or only specific major versions
- Performance characteristics when managing large numbers of fake models in test suites
Package facts
| License | not declared (copyleft) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 175 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 238,148/month — #8,946 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: odoo_test_helper-2.1.3-py3-none-any.whl
Keywords: odoo, project
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
openupgradelibProvides utility functions for Odoo database…
agpl · top 15,000 on PyPI
pylint-odooA Pylint plugin that adds Odoo-specific code…
agpl · top 15,000 on PyPI
pytest-odoopytest-odoo is a pytest plugin that runs Odoo…
agpl · top 15,000 on PyPI
setuptools-odooSetuptools-odoo automates packaging of Odoo…
copyleft · top 15,000 on PyPI
autofakerAutoFaker generates anonymous test data and…
permissive · top 15,000 on PyPI
whoolwhool is a PEP 517 and PEP 660 compliant build…
permissive · top 15,000 on PyPI
manifestoo-coreParses and reasons about Odoo addon manifests,…
permissive · top 15,000 on PyPI
pytest-helpers-namespaceProvides a pytest namespace for registering and…
permissive · top 15,000 on PyPI
django-mock-queriesMocks Django QuerySet operations in memory for…
permissive · top 15,000 on PyPI
pyfakefspyfakefs mocks the Python file system modules…
permissive · top 5,000 on PyPI