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.

35 lines
1.2 KiB

  1. # © 2014-2016 Camptocamp SA
  2. # @author: Nicolas Bessi
  3. # © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  5. from odoo.tests.common import TransactionCase
  6. class TestStreet3(TransactionCase):
  7. def test_partner(self):
  8. # Test address_format has been updated on existing countries
  9. us_country = self.env.ref('base.us')
  10. self.assertTrue('%(street3)s' in us_country.address_format)
  11. homer = self.env['res.partner'].create({
  12. 'name': 'Homer Simpson',
  13. 'city': 'Springfield',
  14. 'street': '742 Evergreen Terrace',
  15. 'street2': 'Donut Lane',
  16. 'street3': 'Tho',
  17. 'country_id': us_country.id,
  18. })
  19. # test synchro of street3 on create
  20. bart = self.env['res.partner'].create({
  21. 'name': 'Bart Simpson',
  22. 'parent_id': homer.id,
  23. 'type': 'contact',
  24. })
  25. self.assertEqual(bart.street3, 'Tho')
  26. # test synchro of street3 on write
  27. homer.write({'street3': 'in OCA we trust'})
  28. self.assertEqual(bart.street3, 'in OCA we trust')