From 0c883a4417b77f28d9f5e63ced0c51fda16c555e Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Wed, 4 Aug 2021 12:49:23 +0000 Subject: [PATCH] [FIX] website: remove s_facebook_page snippet from test It creates race condition, as it contact external ressource, in this case facebook.com. Tests should never call external services anyway, it always lead to race condition. closes odoo/odoo#74704 Signed-off-by: Christophe Monniez (moc) --- addons/website/tests/test_snippets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/website/tests/test_snippets.py b/addons/website/tests/test_snippets.py index 31732bc0335..a469f2549fd 100644 --- a/addons/website/tests/test_snippets.py +++ b/addons/website/tests/test_snippets.py @@ -22,5 +22,8 @@ class TestSnippets(odoo.tests.HttpCase): snippets_template = self.env['ir.ui.view'].render_public_asset('website.snippets') html_template = html.fromstring(snippets_template) data_snippet_els = html_template.xpath("//*[@class='o_panel' and not(contains(@class, 'd-none'))]//*[@data-snippet]") - snippets_names = ','.join([el.attrib['data-snippet'] for el in data_snippet_els]) + blacklist = [ + 's_facebook_page', # avoid call to external services (facebook.com) + ] + snippets_names = ','.join([el.attrib['data-snippet'] for el in data_snippet_els if el.attrib['data-snippet'] not in blacklist]) self.start_tour("/?enable_editor=1&snippets_names=%s" % snippets_names, "snippets_all_drag_and_drop", login='admin', timeout=300)