#NEWLINE# def test_inline_dropbox_preview( self ) : #NEWLINE# #INDENT# msg = 'https://www.dropbox.com/sc/tditp9nitko60n5/03rEiZldy5' #NEWLINE# image_info = { #NEWLINE# #INDENT# 'image' : 'https://photos-6.dropbox.com/t/2/AAAlawaeD61TyNewO5vVi-DGf2ZeuayfyHFdNTNzpGq-QA/12/271544745/jpeg/1024x1024/2/_/0/5/baby-piglet.jpg/CKnjvYEBIAIgBygCKAc/tditp9nitko60n5/AADX03VAIrQlTl28CtujDcMla/0' , #NEWLINE# 'desc' : 'Shared with Dropbox' , #NEWLINE# 'title' : '1 photo' , #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><a href="https://www.dropbox.com/sc/tditp9nitko60n5/03rEiZldy5" target="_blank" title="https://www.dropbox.com/sc/tditp9nitko60n5/03rEiZldy5">https://www.dropbox.com/sc/tditp9nitko60n5/03rEiZldy5</a></p>\n<div class="message_inline_image"><a href="https://www.dropbox.com/sc/tditp9nitko60n5/03rEiZldy5" target="_blank" title="1 photo"><img src="https://photos-6.dropbox.com/t/2/AAAlawaeD61TyNewO5vVi-DGf2ZeuayfyHFdNTNzpGq-QA/12/271544745/jpeg/1024x1024/2/_/0/5/baby-piglet.jpg/CKnjvYEBIAIgBygCKAc/tditp9nitko60n5/AADX03VAIrQlTl28CtujDcMla/0"></a></div>' )