Skip to content

Commit 80aa5ad

Browse files
bvr-odooqsm-odoo
authored andcommitted
[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]: 758e2ab task-3662985 closes #792 X-original-commit: 05cfe05 Signed-off-by: Quentin Smetz (qsm) <[email protected]> Signed-off-by: Benjamin Vray (bvr) <[email protected]>
1 parent 8ab0d1c commit 80aa5ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test_themes/tests/test_new_page_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def check(theme_name, website):
172172
# Only look at blocks in website.snippets
173173
html_tree = blocks_el[0]
174174
for el in html_tree.xpath('//*[@class]'):
175-
classes = el.attrib['class'].split(' ')
175+
classes = el.attrib['class'].split()
176176
classes_inventory.update(classes)
177177
if len(classes) != len(set(classes)):
178178
errors.append("Using %r, view %r contains duplicate classes: %r" % (theme_name, view.key, classes))

0 commit comments

Comments
 (0)