Skip to content

Commit 9ee6b4e

Browse files
committed
[IMP] date_range: Import odoo_test_helper inside setUpClass.
When running unit tests on a odoo container that does not have the odoo_test_helper package installed, the resulting "ModuleNotFoundError: No module named 'odoo_test_helper'" kills the entire run, rather than failing only the tests that require the module.
1 parent 550a198 commit 9ee6b4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

date_range/tests/test_date_range_search_mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Copyright 2021 Opener B.V. <[email protected]>
33
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
44
from dateutil.rrule import MONTHLY
5-
from odoo_test_helper import FakeModelLoader
65

76
from odoo.tests.common import TransactionCase
87

@@ -12,6 +11,7 @@ class TestDateRangeearchMixin(TransactionCase):
1211
def setUpClass(cls):
1312
super().setUpClass()
1413
# Load a test model using odoo_test_helper
14+
from odoo_test_helper import FakeModelLoader
1515
cls.loader = FakeModelLoader(cls.env, cls.__module__)
1616
cls.loader.backup_registry()
1717
from .models import TestDateRangeSearchMixin

0 commit comments

Comments
 (0)