[IMP] test_themes, theme_test_custo: add new test theme for tests

This commit introduces a new theme for tests purpose.
The goal is to be able to create records and simulate a real use case
without only testing through unit tests in python.
For instance, with this commit, we now fully test:
- menu creation
- page creation
- new header & footer template
- new image shape & background shape

This will be extended later to be able to test other stuff too, maybe
like changing the website logo (not supported yet). Also, our existing
standalone test in themes should use this theme instead of nano to not
rely on a real theme that might change.

Courtesy of NMI as this theme is partly based on his job.

closes odoo/design-themes#586

Related: odoo/odoo#99099
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
Romain Derie
2022-08-29 21:55:51 +00:00
parent ca449f01f8
commit 0e2497b8e8
23 changed files with 530 additions and 6 deletions
+1 -6
View File
@@ -10,12 +10,7 @@ def post_init_hook(cr, registry):
''' Create a new website for each theme and install the theme on it. '''
env = api.Environment(cr, SUPERUSER_ID, {})
IrModule = env['ir.module.module']
themes = IrModule.search([
('category_id', 'child_of', env.ref('base.module_category_theme').id),
], order='name')
exclude_list = ['_common', '_blog', '_sale']
themes = themes.filtered(lambda t: not any([ex for ex in exclude_list if ex in t.name]))
themes = IrModule.search(IrModule.get_themes_domain(), order='name')
assert len(themes) == len(env.ref('base.module_test_themes').dependencies_id)
xmlids = []