Skip to Content

Localization Policy — Developer Testing

For module purpose and installation, see the module overview and user manual.

Isolated Odoo tests

Use the repository's addon runner for Odoo integration tests. Run this addon's tests in its own disposable, base-only database, with both localization sources discoverable and neither Accounting nor upstream localization installed. The tests exercise dependency scheduling transactionally through button_install; they do not call immediate installation methods from tests.

Run l10n_si2 and the affected Intrastat tests separately with their addon runners. Full acceptance also requires separate-process fresh-install and existing-database upgrade scenarios on authorized synthetic databases:

  • The two-step policy and Accounting bootstrap.
  • Fallback when the replacement localization is unavailable.
  • A later Slovenian company in a database initially configured for a foreign company.

Successful scheduling tests alone do not prove registry loading or an upgrade.

Database-free policy tests

Pure policy tests are maintained in the external tools directory. They can run without Odoo or PostgreSQL from the repository root using the configured Python interpreter:

PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 <configured-python> -m pytest -c pytest.ini \
    -p no:cacheprovider \
    /srv/pmiverse/_pmitools/pmiverse/tools/l10n_slovenia/tests/test_l10n_pmis_policy.py

Database scope

Use only verified task-owned disposable databases for scoped tests. Their creation, module installation/update, test writes, and cleanup follow the workspace's disposable-test-database authorization. Never point test runners at existing business databases or unowned databases. Production-derived copies, forced disconnection, privilege changes, and dependency installation require separate authority.