diff options
Diffstat (limited to 'addons/link_tracker/tests/common.py')
| -rw-r--r-- | addons/link_tracker/tests/common.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/link_tracker/tests/common.py b/addons/link_tracker/tests/common.py index 2d4c651dcd4..943f06ec385 100644 --- a/addons/link_tracker/tests/common.py +++ b/addons/link_tracker/tests/common.py @@ -23,7 +23,7 @@ class MockLinkTracker(common.BaseCase): def _get_href_from_anchor_id(self, body, anchor_id): html = etree.fromstring(body) - return html.xpath("*[@id='%s']" % anchor_id)[0].attrib.get('href') + return html.xpath("//*[@id='%s']" % anchor_id)[0].attrib.get('href') def _get_tracker_from_short_url(self, short_url): code = self.env['link.tracker.code'].sudo().search([ @@ -41,7 +41,7 @@ class MockLinkTracker(common.BaseCase): ) """ (anchor_id, url, is_shortened) = link_info - anchor_href = self._get_href_from_anchor_id(body, anchor_id) + anchor_href = self._get_href_from_anchor_id("<div>%s</div>" % body, anchor_id) if is_shortened: self.assertTrue('/r/' in anchor_href, '%s should be shortened: %s' % (anchor_id, anchor_href)) link_tracker = self._get_tracker_from_short_url(anchor_href) |
