Host "preview failed" image locally.

Who knows when this Cloudfront URL will stop working!

(imported from commit 39f2908a32c0276b1d87ecedc876c71dd35a9b2f)
This commit is contained in:
Waseem Daher 2014-07-28 23:15:12 -07:00 committed by Waseem Daher
parent 12cb8ceae0
commit 569abda653
2 changed files with 2 additions and 2 deletions

View File

@ -297,7 +297,7 @@ class InlineInterestingLinkProcessor(markdown.treeprocessors.Treeprocessor):
image_info["title"] = filename
image_info["desc"] = ""
# Dropbox's "unable to preview" image
image_info["image"] = "https://dt8kf6553cww8.cloudfront.net/static/images/preview_fail-vflc3IDxf.png"
image_info["image"] = "/static/images/preview_fail.png"
image_info["is_image"] = is_image
return image_info

View File

@ -209,7 +209,7 @@ class BugdownTest(TestCase):
# Don't fail on bad dropbox links
msg = "https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM"
converted = bugdown_convert(msg)
self.assertEqual(converted, '<p><a href="https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM" target="_blank" title="https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM">https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM</a></p>\n<div class="message_inline_image"><a href="https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM" target="_blank" title="ROmr9K1XYtmpneM"><img src="https://dt8kf6553cww8.cloudfront.net/static/images/preview_fail-vflc3IDxf.png"></a></div>')
self.assertEqual(converted, '<p><a href="https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM" target="_blank" title="https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM">https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM</a></p>\n<div class="message_inline_image"><a href="https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM" target="_blank" title="ROmr9K1XYtmpneM"><img src="/static/images/preview_fail.png"></a></div>')
def test_twitter_id_extraction(self):
self.assertEqual(bugdown.get_tweet_id('http://twitter.com/#!/VizzQuotes/status/409030735191097344'), '409030735191097344')