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.

25 lines
728 B

  1. # Copyright 2017-2018 ACSONE SA/NV
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import tools
  4. from odoo.tests import SavepointCase
  5. from psycopg2 import IntegrityError
  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. def test_00_duplicate(self):
  13. # Test Duplicate Company type
  14. with self.assertRaises(IntegrityError), tools.mute_logger(
  15. "odoo.sql_db"):
  16. self.company_type.create(dict(
  17. name=self.company_type.name,
  18. ))