summaryrefslogtreecommitdiff
path: root/addons/website_links/tests
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/website_links/tests
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/website_links/tests')
-rw-r--r--addons/website_links/tests/__init__.py3
-rw-r--r--addons/website_links/tests/test_ui.py28
2 files changed, 31 insertions, 0 deletions
diff --git a/addons/website_links/tests/__init__.py b/addons/website_links/tests/__init__.py
new file mode 100644
index 00000000..1e046233
--- /dev/null
+++ b/addons/website_links/tests/__init__.py
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+from . import test_ui
diff --git a/addons/website_links/tests/test_ui.py b/addons/website_links/tests/test_ui.py
new file mode 100644
index 00000000..a78e54d7
--- /dev/null
+++ b/addons/website_links/tests/test_ui.py
@@ -0,0 +1,28 @@
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from unittest.mock import patch
+
+import odoo.tests
+
+
+@odoo.tests.common.tagged('post_install', '-at_install')
+class TestUi(odoo.tests.HttpCase):
+
+ def setUp(self):
+ super(TestUi, self).setUp()
+
+ def _get_title_from_url(addr, **kw):
+ return 'Contact Us | My Website'
+
+ patcher = patch('odoo.addons.link_tracker.models.link_tracker.LinkTracker._get_title_from_url', wraps=_get_title_from_url)
+ patcher.start()
+ self.addCleanup(patcher.stop)
+
+ def test_01_test_ui(self):
+ self.env['link.tracker'].create({
+ 'campaign_id': 2,
+ 'medium_id': 2,
+ 'source_id': 2,
+ 'url': self.env["ir.config_parameter"].sudo().get_param("web.base.url") + '/contactus',
+ })
+ self.start_tour("/", 'website_links_tour', login="admin")