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.

19 lines
634 B

  1. # Copyright 2016 Akretion (http://www.akretion.com)
  2. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
  3. # @author Alexis de Lattre <alexis.delattre@akretion.com>
  4. from odoo.tests.common import TransactionCase
  5. class TestVatSanitized(TransactionCase):
  6. def test_vat_sanitized(self):
  7. ldlc = self.env['res.partner'].create({
  8. 'name': 'LDLC',
  9. 'is_company': True,
  10. 'vat': 'fr 26 403 554 181'
  11. })
  12. self.assertEqual(ldlc.sanitized_vat, 'FR26403554181')
  13. # Also test invalidation
  14. ldlc.vat = False
  15. self.assertEqual(ldlc.sanitized_vat, False)