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.

20 lines
653 B

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