You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
688 B
22 lines
688 B
# Copyright 2017-2018 ACSONE SA/NV
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
|
|
from psycopg2 import IntegrityError
|
|
|
|
from odoo import tools
|
|
from odoo.tests import SavepointCase
|
|
|
|
|
|
class TestResPartnerCompanyType(SavepointCase):
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
super(TestResPartnerCompanyType, cls).setUpClass()
|
|
cls.company_type = cls.env.ref(
|
|
"partner_company_type.res_partner_company_type_sa"
|
|
)
|
|
|
|
def test_00_duplicate(self):
|
|
# Test Duplicate Company type
|
|
|
|
with self.assertRaises(IntegrityError), tools.mute_logger("odoo.sql_db"):
|
|
self.company_type.create(dict(name=self.company_type.name))
|