aboutsummaryrefslogtreecommitdiff
path: root/tests/docx/footnotes_xml_tests.py
blob: 56caff0b833572c19d3aee0e50999f6bb0123e10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from nose.tools import istest, assert_equal, assert_is

from mammoth.docx.xmlparser import element as xml_element
from mammoth.docx.footnotes_xml import read_footnotes_xml_element


@istest
def id_and_body_of_footnote_are_read():
    footnote_body = [xml_element("w:p")]
    footnotes = read_footnotes_xml_element(xml_element("w:footnotes", {}, [
        xml_element("w:footnote", {"w:id": "1"}, footnote_body),
    ]))
    assert_equal(1, len(footnotes))
    assert_is(footnote_body, footnotes[0].body)
    assert_equal("1", footnotes[0].id)