update todo extension test to test multiple todolists

This tests for regression of previous bug #4214: Two todolist directives break
sphinx-1.6.5.
This commit is contained in:
Matthew Fernandez 2017-11-05 13:48:43 -08:00
parent fd94702eed
commit 1b664248f4
2 changed files with 6 additions and 2 deletions

View File

@ -7,3 +7,5 @@ test for sphinx.ext.todo
bar
.. todolist::
.. todolist::

View File

@ -99,11 +99,13 @@ def test_todo_valid_link(app, status, warning):
content = (app.outdir / 'TodoTests.tex').text()
# Look for the link to foo. We could equally well look for the link to bar.
# Look for the link to foo. Note that there are two of them because the
# source document uses todolist twice. We could equally well look for links
# to bar.
link = r'\{\\hyperref\[\\detokenize\{(.*?foo.*?)}]\{\\sphinxcrossref{' \
r'\\sphinxstyleemphasis{original entry}}}}'
m = re.findall(link, content)
assert len(m) == 1
assert len(m) == 2
target = m[0]
# Look for the targets of this link.