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.

23 lines
778 B

  1. # -*- coding: utf-8 -*-
  2. # © 2016 ONESTEiN BV (<http://www.onestein.eu>)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo.tests.common import TransactionCase
  5. class TestResPartner(TransactionCase):
  6. def setUp(self):
  7. super(TestResPartner, self).setUp()
  8. self.main_partner = self.env.ref('base.main_partner')
  9. def test_display_address(self):
  10. # method name_get() having show_address=True in context
  11. # will invoke method _display_address()
  12. partner_test = self.main_partner.with_context(show_address=True)
  13. displayed_name = partner_test.name_get()
  14. self.assertEqual(
  15. displayed_name[0][1],
  16. 'YourCompany\n1725 Slough Ave.\nScranton PA 18540\nUnited States'
  17. )