#NEWLINE# def test_inline_dropbox( self ) : #NEWLINE# #INDENT# msg = 'Look at how hilarious our old office was: https://www.dropbox.com/s/ymdijjcg67hv2ta/IMG_0923.JPG' #NEWLINE# image_info = { #NEWLINE# #INDENT# 'image' : 'https://photos-4.dropbox.com/t/2/AABIre1oReJgPYuc_53iv0IHq1vUzRaDg2rrCfTpiWMccQ/12/129/jpeg/1024x1024/2/_/0/4/IMG_0923.JPG/CIEBIAEgAiAHKAIoBw/ymdijjcg67hv2ta/AABz2uuED1ox3vpWWvMpBxu6a/IMG_0923.JPG' , #NEWLINE# 'desc' : 'Shared with Dropbox' , #NEWLINE# 'title' : 'IMG_0923.JPG' , #NEWLINE# #UNINDENT# } #NEWLINE# with mock . patch ( 'zerver.lib.bugdown.fetch_open_graph_image' , return_value = image_info ) : #NEWLINE# #INDENT# converted = bugdown_convert ( msg ) #NEWLINE# #UNINDENT# self . assertEqual ( converted , '<p>Look at how hilarious our old office was: <a href="https://www.dropbox.com/s/ymdijjcg67hv2ta/IMG_0923.JPG" target="_blank" title="https://www.dropbox.com/s/ymdijjcg67hv2ta/IMG_0923.JPG">https://www.dropbox.com/s/ymdijjcg67hv2ta/IMG_0923.JPG</a></p>\n<div class="message_inline_image"><a href="https://www.dropbox.com/s/ymdijjcg67hv2ta/IMG_0923.JPG" target="_blank" title="IMG_0923.JPG"><img src="https://www.dropbox.com/s/ymdijjcg67hv2ta/IMG_0923.JPG?dl=1"></a></div>' ) #NEWLINE# msg = 'Look at my hilarious drawing folder: https://www.dropbox.com/sh/cm39k9e04z7fhim/AAAII5NK-9daee3FcF41anEua?dl=' #NEWLINE# image_info = { #NEWLINE# #INDENT# 'image' : 'https://cf.dropboxstatic.com/static/images/icons128/folder_dropbox.png' , #NEWLINE# 'desc' : 'Shared with Dropbox' , #NEWLINE# 'title' : 'Saves' , #NEWLINE# #UNINDENT# } #NEWLINE# with mock . patch ( 'zerver.lib.bugdown.fetch_open_graph_image' , return_value = image_info ) : #NEWLINE# #INDENT# converted = bugdown_convert ( msg ) #NEWLINE# #UNINDENT# self . assertEqual ( msg , '<p>Look at my hilarious drawing folder: <a href="https://www.dropbox.com/sh/cm39k9e04z7fhim/AAAII5NK-9daee3FcF41anEua?dl=" target="_blank" title="https://www.dropbox.com/sh/cm39k9e04z7fhim/AAAII5NK-9daee3FcF41anEua?dl=">https://www.dropbox.com/sh/cm39k9e04z7fhim/AAAII5NK-9daee3FcF41anEua?dl=</a></p>\n<div class="message_inline_ref"><a href="https://www.dropbox.com/sh/cm39k9e04z7fhim/AAAII5NK-9daee3FcF41anEua?dl=" target="_blank" title="Saves"><img src="https://cf.dropboxstatic.com/static/images/icons128/folder_dropbox.png"></a><div><div class="message_inline_image_title">Saves</div><desc class="message_inline_image_desc"></desc></div></div>' )