Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
)
''
'.'
''
''
''
''
'' # noqa
''
''
''
''
'' # noqa
)
self.assert_equal_tree(expected_tree, list(document.parts.values())[0].getroot())
self.assertIsNone(document.settings.getroot().find('{%(w)s}mailMerge' % NAMESPACES))