diff options
Diffstat (limited to 'tests/conversion_tests.py')
| -rw-r--r-- | tests/conversion_tests.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/conversion_tests.py b/tests/conversion_tests.py index 300d1a9..2aec1c1 100644 --- a/tests/conversion_tests.py +++ b/tests/conversion_tests.py @@ -7,7 +7,7 @@ import io from nose.tools import istest, assert_equal from mammoth import documents, style_reader, results, html -from mammoth.conversion import convert_document_element_to_html +from mammoth.conversion import convert_document_element_to_html, _comment_author_label from mammoth.docx.xmlparser import parse_xml @@ -475,6 +475,24 @@ def comment_references_are_linked_to_comment_after_main_body(): assert_equal(expected_html, result.value) +@istest +def when_initials_are_not_blank_then_comment_author_label_is_initials(): + assert_equal("TP", _comment_author_label(documents.comment( + comment_id="0", + body=[], + author_initials="TP", + ))) + + +@istest +def when_initials_are_blank_then_comment_author_label_is_comment(): + assert_equal("Comment", _comment_author_label(documents.comment( + comment_id="0", + body=[], + author_initials=None, + ))) + + def _paragraph_with_text(text): return documents.paragraph(children=[_run_with_text(text)]) |
