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.

22 lines
785 B

  1. # -*- coding: utf-8 -*-
  2. from openerp.tests.common import TransactionCase
  3. import logging
  4. _logger = logging.getLogger(__name__)
  5. class TestSplit(TransactionCase):
  6. def setUp(self):
  7. super(TestSplit, self).setUp()
  8. self.partnerX = self.env.ref('base.res_partner_12')
  9. def test_init1(self):
  10. address = u"278 route pitoresque de la vallee de" \
  11. u" l'ours qui fuit les chasseurs"
  12. partner = self.partnerX
  13. partner.street = address
  14. address1, address2 = partner._get_split_address(2, 40)
  15. self.assertEqual('278 route pitoresque de la vallee de', address1)
  16. self.assertEqual(u"l'ours qui fuit les chasseurs ", address2)
  17. self.assertTrue(len(address1) <= 40)
  18. self.assertTrue(len(address2) <= 40)