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.

16 lines
599 B

  1. # -*- coding: utf-8 -*-
  2. # © 2015 Antiun Ingenieria S.L. - Javier Iniesta
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from openerp.tests.common import TransactionCase
  5. from openerp.exceptions import ValidationError
  6. class TestResPartner(TransactionCase):
  7. def test_check_sectors(self):
  8. sector = self.env['res.partner.sector'].create({'name': 'Test'})
  9. with self.assertRaises(ValidationError):
  10. self.env['res.partner'].create(
  11. {'name': 'Test', 'sector_id': sector.id,
  12. 'secondary_sector_ids': [(4, sector.id)]})