diff --git a/addons/link_tracker/tests/common.py b/addons/link_tracker/tests/common.py index 943f06ec385..6daa1489465 100644 --- a/addons/link_tracker/tests/common.py +++ b/addons/link_tracker/tests/common.py @@ -22,7 +22,8 @@ class MockLinkTracker(common.BaseCase): self.addCleanup(link_tracker_title_patch.stop) def _get_href_from_anchor_id(self, body, anchor_id): - html = etree.fromstring(body) + """ Parse en html body to find the href of an element given its ID. """ + html = etree.fromstring(body, parser=etree.HTMLParser()) return html.xpath("//*[@id='%s']" % anchor_id)[0].attrib.get('href') def _get_tracker_from_short_url(self, short_url): @@ -41,7 +42,7 @@ class MockLinkTracker(common.BaseCase): ) """ (anchor_id, url, is_shortened) = link_info - anchor_href = self._get_href_from_anchor_id("