aboutsummaryrefslogtreecommitdiff
path: root/tests/conversion_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-08-30 11:55:28 +0100
committerMichael Williamson <mike@zwobble.org>2014-08-30 11:55:28 +0100
commitcc671a920c1ce5886fcc6629965000bfc469fea1 (patch)
tree1005d4320810ef9a463aaf7c80e32212360f3554 /tests/conversion_tests.py
parent5f86739e1b61306d716634d7657c6242bffd982a (diff)
Generate HTML for footnotes
Diffstat (limited to 'tests/conversion_tests.py')
-rw-r--r--tests/conversion_tests.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/conversion_tests.py b/tests/conversion_tests.py
index e920551..508d457 100644
--- a/tests/conversion_tests.py
+++ b/tests/conversion_tests.py
@@ -1,3 +1,5 @@
+# coding=utf-8
+
import io
from nose.tools import istest, assert_equal
@@ -268,6 +270,27 @@ def footnote_reference_is_converted_to_superscript_intra_page_link():
assert_equal('<sup><a href="#footnote-42-4" id="footnote-ref-42-4">[1]</a></sup>', result.value)
+@istest
+def footnotes_are_included_after_the_main_body():
+ footnote_reference = documents.footnote_reference("4")
+ document = documents.document(
+ [documents.paragraph([
+ _run_with_text("Knock knock"),
+ documents.run([footnote_reference])
+ ])],
+ footnotes=documents.Footnotes({
+ "4": documents.Footnote("4", [_paragraph_with_text("Who's there?")])
+ })
+ )
+ result = convert_document_element_to_html(
+ document,
+ generate_uniquifier=lambda: 42
+ )
+ expected_html = (u'<p>Knock knock<sup><a href="#footnote-42-4" id="footnote-ref-42-4">[1]</a></sup></p>' +
+ u'<ol><li id="footnote-42-4"><p>Who\'s there? <a href="#footnote-ref-42-4">↑</a></p></li></ol>')
+ assert_equal(expected_html, result.value)
+
+
def _paragraph_with_text(text):
return documents.paragraph(children=[_run_with_text(text)])