def test_exponential_entity_expansion(self):
        try:
            import defusedxml
        except __HOLE__:
            defusedxml = None

        if defusedxml is None:
            raise SkipTest('This test case only applies when using defusedxml')

        document_xml = '''
            <p>
              <r>
                <t>&c;</t>
              </r>
            </p>
        '''
        xml_header = '''<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml [
 <!ENTITY a "123">
 <!ENTITY b "&a;&a;">
 <!ENTITY c "&b;&b;">
]>
        '''
        document = WordprocessingDocumentFactory(xml_header=xml_header)
        document.add(MainDocumentPart, document_xml)

        expected_html = '<p>123123123123</p>'
        try:
            self.assert_document_generates_html(document, expected_html)
            raise AssertionError(
                'Expected "EntitiesForbidden" exception did not occur',
            )
        except defusedxml.EntitiesForbidden:
            pass
dataset/ETHPy150Open CenterForOpenScience/pydocx/tests/export/html/test_xml_vulnerabilities.py/XMLVulnerabilitiesTestCase.test_exponential_entity_expansion