[FIX] web: click all as demo: load menus as demo user

Before this commit, the clickEverywhere test was run for the demo
user on all apps available for the admin. It thus crashed on the
apps that aren't available for the demo user.

closes odoo/odoo#72430

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
This commit is contained in:
Aaron Bohy
2021-06-22 09:02:40 +00:00
parent 36370207b7
commit e973e61c5f
+2 -1
View File
@@ -22,7 +22,8 @@ class TestMenusAdmin(odoo.tests.HttpCase):
class TestMenusDemo(odoo.tests.HttpCase):
def test_01_click_everywhere_as_demo(self):
menus = self.env['ir.ui.menu'].load_menus(False)
user_demo = self.env.ref("base.user_demo")
menus = self.env['ir.ui.menu'].with_user(user_demo.id).load_menus(False)
for app_id in menus['root']['children']:
with self.subTest(app=menus[app_id]['name']):
_logger.runbot('Testing %s', menus[app_id]['name'])