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.

32 lines
1.0 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2017 LasLabs Inc.
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo.tests.common import HttpCase
  5. class TestAccountAnalyticAccount(HttpCase):
  6. def setUp(self):
  7. super(TestAccountAnalyticAccount, self).setUp()
  8. self.account = self.env.ref(
  9. 'website_portal_contract.account_analytic_account_1'
  10. )
  11. self.contract = self.env.ref(
  12. 'website_portal_contract.account_analytic_contract_1'
  13. )
  14. def test_website_template_id(self):
  15. """ Test website_template_id inherited from contract """
  16. self.assertEquals(
  17. self.account.website_template_id,
  18. self.contract.website_template_id,
  19. )
  20. def test_search_contracts(self):
  21. """ Test returns correct contracts """
  22. self.account.partner_id = self.env.ref('base.partner_root')
  23. self.assertIn(
  24. self.account,
  25. self.env['account.analytic.account']._search_contracts(),
  26. )