

def test_internal_image_is_not_included_if_part_is_missing(self):
    width_px = 5
    height_px = 10
    document_xml = '\n            <p>\n            <r>\n              <t>Foo</t>\n              <drawing>\n                <anchor>\n                  <graphic>\n                    <graphicData>\n                      <pic>\n                        <blipFill>\n                          <blip embed="foobar" />\n                        </blipFill>\n                        <spPr>\n                          <xfrm>\n                            <ext cx="{cx}" cy="{cy}"/>\n                          </xfrm>\n                        </spPr>\n                      </pic>\n                    </graphicData>\n                  </graphic>\n                </anchor>\n              </drawing>\n              <t>Bar</t>\n            </r>\n            </p>\n        '.format(cx=(width_px * EMUS_PER_PIXEL), cy=(height_px * EMUS_PER_PIXEL))
    document = WordprocessingDocumentFactory()
    document_rels = document.relationship_format.format(id='foobar', type=ImagePart.relationship_type, target='media/image1.jpeg', target_mode='Internal')
    document.add(MainDocumentPart, document_xml, document_rels)
    expected_html = '<p>FooBar</p>'
    self.assert_document_generates_html(document, expected_html, additional_parts={
        
    })

dataset/ETHPy150Open CenterForOpenScience/pydocx/tests/export/html/test_drawing_graphic_blip.py DrawingGraphicBlipTestCase.test_internal_image_is_not_included_if_part_is_missing/original