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
18 lines
601 B
Python
18 lines
601 B
Python
# -*- 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())
|