#NEWLINE# def test_with_anchor( self ) : #NEWLINE# #INDENT# document_xml = '\n            <p>\n              <hyperlink anchor="testing" id="foobar">\n                <r>\n                  <t>link</t>\n                </r>\n              </hyperlink>\n              <r>\n                <t>.</t>\n              </r>\n            </p>\n        ' #NEWLINE# document = WordprocessingDocumentFactory ( ) #NEWLINE# document_rels = document . relationship_format . format ( id = 'foobar' , type = 'foo/hyperlink' , target = 'http://google.com' , target_mode = 'External' ) #NEWLINE# document . add ( MainDocumentPart , document_xml , document_rels ) #NEWLINE# expected_html = '<p><a href="http://google.com#testing">link</a>.</p>' #NEWLINE# self . assert_document_generates_html ( document , expected_html )