Files
odoo_source/addons/web/tests/test_load_menus.py
T
Achraf (abz) 5cd61fc810 [FIX] web_studio: add background image in the cache hashes
When changing the background image with studio the image does not update.
It works in debug=assets mode.
This is due to the fact that the caching system is not aware of the presence of a possible background image

opw-2696786

closes odoo/odoo#83374

X-original-commit: 184029e3e1e8907e25dd712dd87afd65885695bb
Related: odoo/enterprise#23744
Signed-off-by: Achraf <abz@odoo.com>
2022-01-26 10:15:59 +00:00

54 lines
1.5 KiB
Python

from odoo.tests.common import HttpCase
class LoadMenusTests(HttpCase):
def setUp(self):
super().setUp()
self.menu = self.env["ir.ui.menu"].create({
"name": "test_menu",
"parent_id": False,
})
def search(*args, **kwargs):
return self.menu
self.patch(type(self.env["ir.ui.menu"]), "search", search)
self.authenticate("admin", "admin")
def test_load_menus(self):
menu_loaded = self.url_open("/web/webclient/load_menus/1234")
expected = {
str(self.menu.id): {
"actionID": False,
"actionModel": False,
"appID": self.menu.id,
"children": [],
"id": self.menu.id,
"name": "test_menu",
"webIcon": False,
"webIconData": False,
"xmlid": ""
},
"root": {
"actionID": False,
"actionModel": False,
"appID": False,
"children": [
self.menu.id,
],
"id": "root",
"name": "root",
"webIcon": None,
"webIconData": None,
"xmlid": "",
"backgroundImage": None,
}
}
self.assertDictEqual(
menu_loaded.json(),
expected,
"load_menus didn't return the expected value"
)