pass file-like object to Docx.render method

This commit is contained in:
dandds
2018-12-21 14:05:45 -05:00
parent 5cf2534445
commit 6527f72e78
3 changed files with 11 additions and 10 deletions

View File

@@ -6,7 +6,8 @@ from atst.utils.docx import Docx
def test_render_docx():
data = {"droid_class": "R2"}
docx_file = Docx.render(data=data)
byte_str = BytesIO()
docx_file = Docx.render(byte_str, data=data)
zip_ = ZipFile(docx_file, mode="r")
document = zip_.read(Docx.DOCUMENT_FILE)
assert b"droid_class: R2" in document