skillfed

odoo-test-helper

Our Odoo project tools

odoo-test-helper v2.1.3 238.1K downloads/30d#8,946 on PyPI13
Copyleft license Active released

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-helper

uv

uv add odoo-test-helper

poetry

poetry add odoo-test-helper

Installing 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

Development Status :: 2 - Pre-AlphaFramework :: OdooIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)Natural Language :: EnglishProgramming Language :: Python :: 3

Tags

odoo testing utilitiesfake models odoo testsodoo test framework helpersodoo unit testing toolstest model loader odooodoo savepoint testing
odoo-testingtest-fixtures

More Testing packages