Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1,2 @@
from . import test_components
from . import test_component_collection

View file

@ -0,0 +1,24 @@
# Copyright 2013-2019 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.addons.component.tests.common import TransactionComponentCase
from odoo.addons.test_component.components.components import UserTestComponent
class TestComponentCollection(TransactionComponentCase):
def setUp(self):
super().setUp()
self.collection = self.env["test.component.collection"].create({"name": "Test"})
def tearDown(self):
super().tearDown()
def test_component_by_name(self):
with self.collection.work_on("res.users") as work:
component = work.component_by_name(name="test.user.component")
self.assertEqual(UserTestComponent._name, component._name)
def test_components_usage(self):
with self.collection.work_on("res.users") as work:
component = work.component(usage="test1")
self.assertEqual(UserTestComponent._name, component._name)

View file

@ -0,0 +1,30 @@
# Copyright 2019 Camptocamp SA
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
from odoo.addons.component.tests.common import TransactionComponentCase
class TestComponentInheritance(TransactionComponentCase):
def setUp(self):
super().setUp()
self.collection = self.env["test.component.collection"].create({"name": "Test"})
def test_inherit_base(self):
with self.collection.work_on("res.users") as work:
component = work.component_by_name("base")
self.assertEqual("test_inherit_base", component.test_inherit_base())
def test_inherit_component(self):
with self.collection.work_on("res.users") as work:
component = work.component_by_name("mapper")
self.assertEqual(
"test_inherit_component", component.test_inherit_component()
)
def test_inherit_prototype_component(self):
with self.collection.work_on("res.users") as work:
component = work.component_by_name("test.mapper")
self.assertEqual(
"test_inherit_component", component.test_inherit_component()
)
self.assertEqual("test.mapper", component.name())