aboutsummaryrefslogtreecommitdiff
path: root/tests/mammoth_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mammoth_tests.py')
-rw-r--r--tests/mammoth_tests.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py
index 7ef8049..f744711 100644
--- a/tests/mammoth_tests.py
+++ b/tests/mammoth_tests.py
@@ -1,3 +1,5 @@
+# coding=utf-8
+
from nose.tools import istest, assert_equal
from .testing import test_path
@@ -52,6 +54,23 @@ def word_tables_are_converted_to_html_tables():
assert_equal([], result.messages)
assert_equal(expected_html, result.value)
+
+@istest
+def footnotes_are_appended_to_text():
+ # TODO: don't duplicate footnotes with multiple references
+ expected_html = (u'<p>Ouch' +
+ u'<sup><a href="#footnote-42-1" id="footnote-ref-42-1">[1]</a></sup>.' +
+ u'<sup><a href="#footnote-42-2" id="footnote-ref-42-2">[2]</a></sup></p>' +
+ u'<ol><li id="footnote-42-1"><p> A tachyon walks into a bar. <a href="#footnote-ref-42-1">↑</a></p></li>' +
+ u'<li id="footnote-42-2"><p> Fin. <a href="#footnote-ref-42-2">↑</a></p></li></ol>')
+
+ with open(test_path("footnotes.docx"), "rb") as fileobj:
+ result = mammoth.convert_to_html(fileobj=fileobj, generate_uniquifier=lambda: 42)
+ # TODO: get rid of warnings
+ #~ assert_equal([], result.messages)
+ assert_equal(expected_html, result.value)
+
+
@istest
def transform_document_is_applied_to_document_before_conversion():
def transform_document(document):