Skip to content

Commit b599ed6

Browse files
authored
Merge pull request #80 from petrus-v/support-odoo-18
Support odoo>=18.0
2 parents f602202 + ab42d63 commit b599ed6

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

pytest_odoo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import pytest
2020

2121
import odoo
22-
import odoo.tests
2322

2423

2524
def pytest_addoption(parser):
@@ -165,7 +164,7 @@ def load_registry():
165164
# since Odoo sets it when loading test suites.
166165
threading.current_thread().testing = True
167166
with _worker_db_name() as db_name:
168-
odoo.registry(db_name)
167+
odoo.modules.registry.Registry(db_name)
169168
yield
170169

171170

tests/mock/odoo/odoo/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
from mock import MagicMock
2-
registry = MagicMock()
1+
from . import tests
2+
from unittest.mock import MagicMock
3+
modules = MagicMock()
34
tools = MagicMock()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
from mock import MagicMock
1+
from unittest.mock import MagicMock
22
common = MagicMock()

tests/mock/odoo/pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[build-system]
2+
requires = ["hatchling", "hatch-odoo"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "odoo"
7+
version = "0.1.0"
8+
description = "Fake odoo used in unitest to avoid testing against real odoo"
9+
dependencies = [
10+
]
11+
12+
[tool.hatch.build]
13+
packages = ["odoo"]

tests/mock/odoo/setup.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)