def test_export_docx_to_html_rotate_image(self):
        mock_request()

        docx_file_path = get_fixture('rotate_image.docx')

        signed_request = get_fixture('upload_signed_request.json', as_binary=True)

        html_file_content = get_fixture(
            'rotate_image.html',
            as_binary=True
        )

        kwargs = {
            's3_upload': signed_request,
            'unique_filename': False
        }

        html = self.exporter(docx_file_path, **kwargs).export()

        assert_html_equal(html, html_file_content)
    def test_export_docx_to_html_with_image_upload_to_s3(self):
        mock_request()

        docx_file_path = get_fixture('png_basic_resize_linked_photo.docx')

        signed_request = get_fixture('upload_signed_request.json', as_binary=True)

        html_file_content = get_fixture(
            'png_basic_s3_upload.html',
            as_binary=True
        )

        kwargs = {
            's3_upload': signed_request,
            'unique_filename': False
        }

        html = self.exporter(docx_file_path, **kwargs).export()

        assert_html_equal(html, html_file_content)
    def test_export_external_image(self):
        mock_request()

        responses.add(responses.GET, 'https://www.google.com/images/srpr/logo11w.png',
                      body=get_fixture('logo11w.png'), status=200, content_type='image/png')

        docx_file_path = get_fixture('external_image.docx')

        html_file_content = get_fixture(
            'external_image.html',
            as_binary=True
        )

        signed_request = get_fixture('upload_signed_request.json', as_binary=True)

        kwargs = {
            's3_upload': signed_request,
            'unique_filename': False
        }

        html = self.exporter(docx_file_path, **kwargs).export()

        assert_html_equal(html_file_content, html)