test_ui.py 884 B

12345678910111213141516171819202122232425262728
  1. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  2. from unittest.mock import patch
  3. import odoo.tests
  4. @odoo.tests.common.tagged('post_install', '-at_install')
  5. class TestUi(odoo.tests.HttpCase):
  6. def setUp(self):
  7. super(TestUi, self).setUp()
  8. def _get_title_from_url(addr, **kw):
  9. return 'Contact Us | My Website'
  10. patcher = patch('odoo.addons.link_tracker.models.link_tracker.LinkTracker._get_title_from_url', wraps=_get_title_from_url)
  11. self.startPatcher(patcher)
  12. def test_01_test_ui(self):
  13. self.env['link.tracker'].search_or_create({
  14. 'campaign_id': 2,
  15. 'medium_id': 2,
  16. 'source_id': 2,
  17. 'url': self.env["ir.config_parameter"].sudo().get_param("web.base.url") + '/contactus',
  18. })
  19. self.start_tour("/", 'website_links_tour', login="admin")