oca-ocb-crm/odoo-bringout-oca-ocb-crm_sms/crm_sms/tests/test_crm_lead.py
Ernad Husremovic 7221b9ac46 19.0 vanilla
2026-03-09 09:30:53 +01:00

26 lines
960 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.crm.tests.common import TestCrmCommon
from odoo.tests.common import users
class TestCRMLead(TestCrmCommon):
@users('user_sales_manager')
def test_phone_mobile_update(self):
lead = self.env['crm.lead'].create({
'name': 'Lead 1',
'country_id': self.env.ref('base.us').id,
'phone': self.test_phone_data[0],
})
self.assertEqual(lead.phone, self.test_phone_data[0])
self.assertEqual(lead.phone_sanitized, self.test_phone_data_sanitized[0])
lead.write({'phone': False})
self.assertFalse(lead.phone)
self.assertEqual(lead.phone_sanitized, False)
lead.write({'phone': self.test_phone_data[1]})
self.assertEqual(lead.phone, self.test_phone_data[1])
self.assertEqual(lead.phone_sanitized, self.test_phone_data_sanitized[1])