From 80aa5ad40ef6370db9b0c2536b5a229d10314fc4 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Mon, 18 Mar 2024 13:25:06 +0100 Subject: [PATCH] [FIX] test_themes: fix test new page templates The following commit [1] added a test to verify that there are no duplicate classes in the elements of predefined page templates. This test worked fine until it failed when we attempted to merge a commit in which a template is rendered with empty spaces in the class attribute of an element. The test considered the empty spaces as classes and therefore assumed that two identical classes existed. This commit excludes empty spaces when retrieving classes in this test. [1]: https://github.com/odoo/design-themes/commit/758e2ab819df37c56103b1e82f1e6358b3dba00c task-3662985 closes odoo/design-themes#792 X-original-commit: 05cfe05280da4419bffc788646ad32800d5af0a6 Signed-off-by: Quentin Smetz (qsm) Signed-off-by: Benjamin Vray (bvr) --- test_themes/tests/test_new_page_templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_themes/tests/test_new_page_templates.py b/test_themes/tests/test_new_page_templates.py index 79e147be7..3cd5007a5 100644 --- a/test_themes/tests/test_new_page_templates.py +++ b/test_themes/tests/test_new_page_templates.py @@ -172,7 +172,7 @@ class TestNewPageTemplates(TransactionCase): # Only look at blocks in website.snippets html_tree = blocks_el[0] for el in html_tree.xpath('//*[@class]'): - classes = el.attrib['class'].split(' ') + classes = el.attrib['class'].split() classes_inventory.update(classes) if len(classes) != len(set(classes)): errors.append("Using %r, view %r contains duplicate classes: %r" % (theme_name, view.key, classes))