def test_internal_image_is_included_with_base64_content(self):
        width_px = 5
        height_px = 10

        document_xml = '''
            <p>
            <r>
              <t>Foo</t>
              <drawing>
                <anchor>
                  <graphic>
                    <graphicData>
                      <pic>
                        <blipFill>
                          <blip embed="foobar" />
                        </blipFill>
                        <spPr>
                          <xfrm>
                            <ext cx="{cx}" cy="{cy}"/>
                          </xfrm>
                        </spPr>
                      </pic>
                    </graphicData>
                  </graphic>
                </anchor>
              </drawing>
              <t>Bar</t>
            </r>
            </p>
        '''.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)

        image_data = 'fake data'

        expected_html = '''
            <p>
              Foo
              <img
                height="{height}px"
                src="data:image/jpeg;base64,{data}"
                width="{width}px"
              />
              Bar
            </p>
        '''.format(
            width=width_px,
            height=height_px,
            # This is kind of weird, needed otherwise python 3.3 breaks
            data=base64.b64encode(image_data.encode('utf-8')).decode('utf-8'),
        )

        self.assert_document_generates_html(
            document,
            expected_html,
            additional_parts={
                'word/media/image1.jpeg': image_data,
            },
        )
dataset/ETHPy150Open CenterForOpenScience/pydocx/tests/export/html/test_drawing_graphic_blip.py/DrawingGraphicBlipTestCase.test_internal_image_is_included_with_base64_content/original