summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-07-03 12:20:25 +0100
committerMichael Williamson <mike@zwobble.org>2016-07-03 12:20:25 +0100
commit36e3ce588ad6f55d28a52ff9e10b6bfdb52e0a7b (patch)
treedb26f3d96811179991d3a7a2d429a09a0e156e44 /tests
parent05d9ac1031dcf83c6d99fa2218ee45a6d7b4d746 (diff)
Add stubbed author_name and author_initials to Comment
Diffstat (limited to 'tests')
-rw-r--r--tests/docx/comments_xml_tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/docx/comments_xml_tests.py b/tests/docx/comments_xml_tests.py
index 2970922..5025a21 100644
--- a/tests/docx/comments_xml_tests.py
+++ b/tests/docx/comments_xml_tests.py
@@ -16,3 +16,12 @@ def id_and_body_of_comment_is_read():
assert_equal(comments.value[0].body, [documents.paragraph(children=[])])
assert_equal("1", comments.value[0].comment_id)
+
+@istest
+def when_optional_attributes_of_comment_are_missing_then_they_are_as_none():
+ comments = create_comments_reader(body_xml.reader())(xml_element("w:comments", {}, [
+ xml_element("w:comment", {"w:id": "1"}, []),
+ ]))
+ comment, = comments.value
+ assert_equal(None, comment.author_name)
+ assert_equal(None, comment.author_initials)