From ab2918d03197d412ab5013fb850d22c89a7cc502 Mon Sep 17 00:00:00 2001 From: Nicholas Riegel Date: Fri, 29 May 2026 22:22:56 -0400 Subject: [PATCH] test: add conftest to auto-install addon for pytest-odoo Create a session-scoped fixture that installs itsulu_blog_publisher and its dependencies before test execution. This ensures the Odoo registry knows about our models when tests run. Co-Authored-By: Claude Haiku 4.5 --- conftest.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..24303e3 --- /dev/null +++ b/conftest.py @@ -0,0 +1,14 @@ +""" +pytest configuration for itsulu-blog-publisher tests. +Ensures the addon is installed into the test database before tests run. +""" +import pytest + + +@pytest.fixture(scope='session', autouse=True) +def install_addon(env): + """Install itsulu_blog_publisher and dependencies before tests run.""" + env['ir.module.module'].search([ + ('name', 'in', ['base', 'website', 'website_blog', 'mail', 'itsulu_blog_publisher']) + ]).button_install() + env.cr.commit()