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

  1. # Copyright 2017-2018 ACSONE SA/NV
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from psycopg2 import IntegrityError
  4. from odoo import tools
  5. from odoo.tests import SavepointCase
  6. class TestResPartnerCompanyType(SavepointCase):
  7. @classmethod
  8. def setUpClass(cls):
  9. super(TestResPartnerCompanyType, cls).setUpClass()
  10. cls.company_type = cls.env.ref(
  11. "partner_company_type.res_partner_company_type_sa"
  12. )
  13. def test_00_duplicate(self):
  14. # Test Duplicate Company type
  15. with self.assertRaises(IntegrityError), tools.mute_logger("odoo.sql_db"):
  16. self.company_type.create(dict(name=self.company_type.name))