diff --git a/swh/web/tests/common/test_utils.py b/swh/web/tests/common/test_utils.py --- a/swh/web/tests/common/test_utils.py +++ b/swh/web/tests/common/test_utils.py @@ -6,6 +6,8 @@ import datetime from urllib.parse import quote +import docutils +from pkg_resources import parse_version import pytest from django.conf.urls import url @@ -122,24 +124,29 @@ "#. It has two items too.\n" ) + if parse_version(docutils.__version__) >= parse_version("0.17"): + (section_open, section_close) = ("section", "section") + else: + (section_open, section_close) = ('div class="section"', "div") + expected_html = ( - '
Some strong text
\n" - 'This is a bulleted list.
It has two items, the second\n" - "item uses two lines.
This is a numbered list.
It has two items too.
This is a numbered list.
It has two items too.
Some strong text
\n" + f'<{section_open} id="subsection">\n' + f"This is a bulleted list.
It has two items, the second\n" + f"item uses two lines.
This is a numbered list.
It has two items too.
This is a numbered list.
It has two items too.