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.

29 lines
971 B

  1. # Copyright 2019 Luis M. Ontalba <luismaront@gmail.com>
  2. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
  3. from odoo.tests import common
  4. class TestPartnerAcademicTitle(common.SavepointCase):
  5. @classmethod
  6. def setUpClass(cls):
  7. super(TestPartnerAcademicTitle, cls).setUpClass()
  8. cls.partner_ac_tit_A = cls.env['partner.academic.title'].create({
  9. 'name': 'A',
  10. 'sequence': 2,
  11. })
  12. cls.partner_ac_tit_B = cls.env['partner.academic.title'].create({
  13. 'name': 'B',
  14. 'sequence': 1,
  15. })
  16. cls.partner = cls.env['res.partner'].create({
  17. 'name': 'Test partner',
  18. })
  19. def test_compute_academic_title_display(self):
  20. partner = self.partner
  21. partner.academic_title_ids = [
  22. (4, self.partner_ac_tit_A.id, 0),
  23. (4, self.partner_ac_tit_B.id, 0),
  24. ]
  25. self.assertEqual(partner.academic_title_display, "B, A")