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.

27 lines
886 B

  1. # Copyright 2018 - TODAY Serpent Consulting Services Pvt. Ltd.
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo.tests.common import TransactionCase
  4. class TestResPartner(TransactionCase):
  5. def setUp(self):
  6. super(TestResPartner, self).setUp()
  7. self.PartnerObj = self.env['res.partner']
  8. self.partner_id = self.PartnerObj.create({
  9. 'name': 'Serpent',
  10. 'mobile': '1234567890',
  11. 'email': 'abc.serpentcs@gmail.com',
  12. 'customer': True,
  13. 'city': 'india',
  14. })
  15. def test_name_search(self):
  16. partner_ids = self.PartnerObj.name_search(
  17. name="1234567890",
  18. operator='ilike',
  19. args=[('id', 'in', self.partner_id.ids)]
  20. )
  21. self.assertEqual(set([self.partner_id.id]),
  22. set([a[0] for a in partner_ids]))