mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-22 06:32:04 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
3
odoo-bringout-oca-brand-brand/brand/tests/__init__.py
Normal file
3
odoo-bringout-oca-brand-brand/brand/tests/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from . import test_brand
|
||||
from . import test_brand_mixin
|
||||
from . import common
|
||||
24
odoo-bringout-oca-brand-brand/brand/tests/common.py
Normal file
24
odoo-bringout-oca-brand-brand/brand/tests/common.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
from odoo.tests import tagged
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
@tagged("post_install", "-at_install")
|
||||
class CommonCase(TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
|
||||
cls.brand_model = cls.env["res.brand"]
|
||||
cls.company_model = cls.env["res.company"]
|
||||
cls.partner_model = cls.env["res.partner"]
|
||||
|
||||
cls.company_no_brand = cls.company_model.create({"name": "No Brand Company"})
|
||||
cls.company_optional_brand = cls.company_model.create(
|
||||
{"name": "Optional Brand Company", "brand_use_level": "optional"}
|
||||
)
|
||||
cls.company_required_brand = cls.company_model.create(
|
||||
{"name": "Required Brand Company", "brand_use_level": "required"}
|
||||
)
|
||||
|
||||
cls.partner = cls.partner_model.create({"name": "Test Partner"})
|
||||
cls.brand = cls.brand_model.create({"partner_id": cls.partner.id})
|
||||
8
odoo-bringout-oca-brand-brand/brand/tests/test_brand.py
Normal file
8
odoo-bringout-oca-brand-brand/brand/tests/test_brand.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from .common import CommonCase
|
||||
|
||||
|
||||
class TestBrandMixin(CommonCase):
|
||||
def test_brand_creation(self):
|
||||
"""Test creation of a brand."""
|
||||
brand = self.brand_model.create({"partner_id": self.partner.id})
|
||||
self.assertTrue(brand.exists())
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
from lxml import etree
|
||||
|
||||
from .common import CommonCase
|
||||
|
||||
|
||||
class TestBrand(CommonCase):
|
||||
def test_get_view(self):
|
||||
view = self.env["res.config.settings"].get_view(
|
||||
view_id=self.env.ref("base.res_config_settings_view_form").id,
|
||||
view_type="form",
|
||||
)
|
||||
doc = etree.XML(view["arch"])
|
||||
self.assertTrue(doc.xpath("//field[@name='brand_use_level']"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue