summaryrefslogtreecommitdiff
path: root/addons/website_event/tests/common.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-07-08 10:50:47 +0000
committerThibault Delavallée <tde@odoo.com>2020-07-23 09:55:02 +0000
commitcbee702ba4f3efa8fe794c8e2416e6584564ff0b (patch)
tree80512023758443be8ac373a2a67b36db3bc9d90a /addons/website_event/tests/common.py
parent1db746419f566a6299aaead8f0f8b6bb279732e2 (diff)
[REF] website_event(_track): improve tests and test classes
RATIONALE Even will soon gain a major update called Event Online, allowing to better support full-online events. In order to prepare its merge, preparatory merge are done to lessen the final diff., ... SPECIFICATIONS Improve website_event and website_event_track test coding style, notably * use specific users when performing tests to trigger access rights issues (this notably allowed to find an issue with event groups not allowed to update menus); * define common classes; LINKS PR #54801 Task ID 2304817 (Event Preparation 3) Prepares Task ID 2252655 (Main Online Event task) Prepares Task ID 2283796 (Event B2Basics) X-original-commit: 774211c7e4667c5350ac090510e72c106f2d10b6
Diffstat (limited to 'addons/website_event/tests/common.py')
-rw-r--r--addons/website_event/tests/common.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/addons/website_event/tests/common.py b/addons/website_event/tests/common.py
new file mode 100644
index 00000000000..b4bd532ab04
--- /dev/null
+++ b/addons/website_event/tests/common.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo.addons.event.tests.common import TestEventCommon
+
+
+class TestWebsiteEventCommon(TestEventCommon):
+
+ def _get_menus(self):
+ return set(['Introduction', 'Location', 'Register'])
+
+ def _assert_website_menus(self, event):
+ self.assertTrue(event.menu_id)
+
+ menus = self.env['website.menu'].search([('parent_id', '=', event.menu_id.id)])
+ self.assertEqual(len(menus), len(self._get_menus()))
+ self.assertEqual(set(menus.mapped('name')), self._get_menus())