diff --git a/tests/order.py b/tests/order.py index 3ca546a..5542feb 100644 --- a/tests/order.py +++ b/tests/order.py @@ -19,8 +19,7 @@ context = { 'in_europe' : True, 'is_paid': False, 'company_name' : 'The World Wide company', - 'total_price' : '100,000,000.00', - 'category' : 'BOOK' + 'total_price' : '100,000,000.00' } tpl.render(context) diff --git a/tests/test_files/.DS_Store b/tests/test_files/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/tests/test_files/.DS_Store differ diff --git a/tests/test_files/order.docx b/tests/test_files/order.docx index e7f88e8..951457a 100644 Binary files a/tests/test_files/order.docx and b/tests/test_files/order.docx differ diff --git a/tests/test_files/order_tpl.docx b/tests/test_files/order_tpl.docx index 01cd3a0..5dd7343 100644 Binary files a/tests/test_files/order_tpl.docx and b/tests/test_files/order_tpl.docx differ diff --git a/tests/test_files/vertical_merge.docx b/tests/test_files/vertical_merge.docx new file mode 100644 index 0000000..7c90726 Binary files /dev/null and b/tests/test_files/vertical_merge.docx differ diff --git a/tests/test_files/vertical_merge_tpl.docx b/tests/test_files/vertical_merge_tpl.docx new file mode 100644 index 0000000..c450409 Binary files /dev/null and b/tests/test_files/vertical_merge_tpl.docx differ diff --git a/tests/vertical merge.py b/tests/vertical merge.py new file mode 100644 index 0000000..d2877d6 --- /dev/null +++ b/tests/vertical merge.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +''' +Created : 2017-10-15 + +@author: Arthaslixin +''' + +from docxtpl import DocxTemplate + +tpl=DocxTemplate('test_files/vertical_merge_tpl.docx') + +context = { + 'items' : [ + {'desc' : 'Python interpreters', 'qty' : 2, 'price' : 'FREE' }, + {'desc' : 'Django projects', 'qty' : 5403, 'price' : 'FREE' }, + {'desc' : 'Guido', 'qty' : 1, 'price' : '100,000,000.00' }, + ], + 'total_price' : '100,000,000.00', + 'category' : 'Book' +} + +tpl.render(context) +tpl.save('test_files/vertical_merge.docx')