Browse Source

[IMP] - Add unit tests

12.0
sbejaoui 5 years ago
parent
commit
fd82e4ed0f
  1. 1
      partner_industry_parent/__init__.py
  2. 1
      partner_industry_parent/tests/__init__.py
  3. 26
      partner_industry_parent/tests/test_res_partner_industry.py

1
partner_industry_parent/__init__.py

@ -1 +1,2 @@
from . import models from . import models
from . import tests

1
partner_industry_parent/tests/__init__.py

@ -0,0 +1 @@
from . import test_res_partner_industry

26
partner_industry_parent/tests/test_res_partner_industry.py

@ -0,0 +1,26 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestResPartnerIndustry(TransactionCase):
def setUp(self):
super(TestResPartnerIndustry, self).setUp()
self.industry_1 = self.env.ref('base.res_partner_industry_O')
self.industry_2 = self.env.ref('base.res_partner_industry_P')
self.industry_3 = self.env.ref('base.res_partner_industry_Q')
def test_res_partner_industry_complete_name(self):
self.assertEqual(
self.industry_1.complete_name, 'Public Administration'
)
self.industry_1.parent_id = self.industry_2
self.assertEqual(
self.industry_1.complete_name, 'Education / Public Administration'
)
self.industry_2.parent_id = self.industry_3
self.assertEqual(
self.industry_1.complete_name,
'Health/Social / Education / Public Administration',
)
Loading…
Cancel
Save