mirror of
https://gitlab.com/itsulu-odoo/itsulu-blog-publisher.git
synced 2026-05-30 23:41:23 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
fb97becedc
commit
ab2918d031
1 changed files with 14 additions and 0 deletions
14
conftest.py
Normal file
14
conftest.py
Normal file
|
|
@ -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()
|
||||
Loading…
Reference in a new issue