From cc671a920c1ce5886fcc6629965000bfc469fea1 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 30 Aug 2014 11:55:28 +0100 Subject: Generate HTML for footnotes --- tests/conversion_tests.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests') 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('[1]', 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'

Knock knock[1]

' + + u'
  1. Who\'s there? ↑

') + assert_equal(expected_html, result.value) + + def _paragraph_with_text(text): return documents.paragraph(children=[_run_with_text(text)]) -- cgit v1.2.3