How to use the mailmerge.NAMESPACES function in mailmerge

To help you get started, we’ve selected a few mailmerge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Bouke / docx-mailmerge / tests / test_merge_table_rows.py View on Github external
def test_merge_rows_remove_table(self):
        """
        When flag is set and there is no data in a table, table needs to be removed
        """
        self.document.remove_empty_tables = True
        self.document.merge(
            student_name='Bouke Haarsma',
            study='Industrial Engineering and Management',
            thesis_grade='A',
            class_code=[]
        )

        with tempfile.TemporaryFile() as outfile:
            self.document.write(outfile)
        self.assertIsNone(
            list(self.document.parts.values())[0].getroot().find('.//{%(w)s}tbl' % NAMESPACES)
        )
github Bouke / docx-mailmerge / tests / test_winword2010.py View on Github external
''
                    '.'
                  ''
                ''
                ''
                  ''
                  ''  # noqa
                  ''
                  ''
                ''
              ''
            ''  # noqa
        )

        self.assert_equal_tree(expected_tree, list(document.parts.values())[0].getroot())
        self.assertIsNone(document.settings.getroot().find('{%(w)s}mailMerge' % NAMESPACES))