mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
Fix twitter mock data.
This commit is contained in:
committed by
Tim Abbott
parent
fb1d00fc6c
commit
c389d22b5f
@@ -7,83 +7,63 @@ import ujson
|
|||||||
|
|
||||||
|
|
||||||
NORMAL_TWEET = """{
|
NORMAL_TWEET = """{
|
||||||
"coordinates": null,
|
|
||||||
"created_at": "Sat Sep 10 22:23:38 +0000 2011",
|
"created_at": "Sat Sep 10 22:23:38 +0000 2011",
|
||||||
"truncated": false,
|
|
||||||
"favorited": false,
|
|
||||||
"id_str": "112652479837110273",
|
"id_str": "112652479837110273",
|
||||||
"in_reply_to_user_id_str": "783214",
|
"in_reply_to_user_id_str": "783214",
|
||||||
"text": "@twitter meets @seepicturely at #tcdisrupt cc.@boscomonkey @episod http://t.co/6J2EgYM",
|
"text": "@twitter meets @seepicturely at #tcdisrupt cc.@boscomonkey @episod http://t.co/6J2EgYM",
|
||||||
"contributors": null,
|
"source": "<a href=\\"http://instagram.com\\" rel=\\"nofollow\\">Instagram</a>",
|
||||||
|
"lang": "en",
|
||||||
"id": 112652479837110273,
|
"id": 112652479837110273,
|
||||||
"retweet_count": 0,
|
|
||||||
"in_reply_to_status_id_str": null,
|
|
||||||
"geo": null,
|
|
||||||
"retweeted": false,
|
|
||||||
"possibly_sensitive": false,
|
|
||||||
"in_reply_to_user_id": 783214,
|
"in_reply_to_user_id": 783214,
|
||||||
|
"favorite_count": 3,
|
||||||
|
"hashtags": [
|
||||||
|
{
|
||||||
|
"text": "tcdisrupt"
|
||||||
|
}
|
||||||
|
],
|
||||||
"user": {
|
"user": {
|
||||||
"profile_sidebar_border_color": "eeeeee",
|
|
||||||
"profile_background_tile": true,
|
|
||||||
"profile_sidebar_fill_color": "efefef",
|
"profile_sidebar_fill_color": "efefef",
|
||||||
"name": "Eoin McMillan ",
|
"name": "Eoin McMillan ",
|
||||||
"profile_image_url": "http://a1.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
"profile_image_url": "http://a1.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
||||||
"created_at": "Mon May 16 20:07:59 +0000 2011",
|
"created_at": "Mon May 16 20:07:59 +0000 2011",
|
||||||
"location": "Twitter",
|
"location": "Twitter",
|
||||||
"profile_link_color": "009999",
|
"profile_link_color": "009999",
|
||||||
"follow_request_sent": null,
|
|
||||||
"is_translator": false,
|
|
||||||
"id_str": "299862462",
|
"id_str": "299862462",
|
||||||
"favourites_count": 0,
|
"favourites_count": 0,
|
||||||
"default_profile": false,
|
|
||||||
"url": "http://www.eoin.me",
|
"url": "http://www.eoin.me",
|
||||||
"contributors_enabled": false,
|
|
||||||
"id": 299862462,
|
"id": 299862462,
|
||||||
"utc_offset": null,
|
"utc_offset": null,
|
||||||
"profile_image_url_https": "https://si0.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
"profile_image_url_https": "https://si0.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
||||||
"profile_use_background_image": true,
|
|
||||||
"listed_count": 0,
|
"listed_count": 0,
|
||||||
"followers_count": 9,
|
"followers_count": 9,
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"profile_text_color": "333333",
|
"profile_text_color": "333333",
|
||||||
"protected": false,
|
|
||||||
"profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme14/bg.gif",
|
"profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme14/bg.gif",
|
||||||
"description": "Eoin's photography account. See @mceoin for tweets.",
|
"description": "Eoin's photography account. See @mceoin for tweets.",
|
||||||
"geo_enabled": false,
|
"geo_enabled": false,
|
||||||
"verified": false,
|
|
||||||
"profile_background_color": "131516",
|
"profile_background_color": "131516",
|
||||||
"time_zone": null,
|
"time_zone": null,
|
||||||
"notifications": null,
|
|
||||||
"statuses_count": 255,
|
"statuses_count": 255,
|
||||||
"friends_count": 0,
|
"friends_count": 0,
|
||||||
"default_profile_image": false,
|
|
||||||
"profile_background_image_url": "http://a1.twimg.com/images/themes/theme14/bg.gif",
|
"profile_background_image_url": "http://a1.twimg.com/images/themes/theme14/bg.gif",
|
||||||
"screen_name": "imeoin",
|
"screen_name": "imeoin",
|
||||||
"following": null,
|
"statuses_count": 270
|
||||||
"show_all_inline_media": false
|
|
||||||
},
|
},
|
||||||
"in_reply_to_screen_name": "twitter",
|
|
||||||
"in_reply_to_status_id": null,
|
|
||||||
"user_mentions": [
|
"user_mentions": [
|
||||||
{
|
{
|
||||||
"screen_name": "twitter",
|
"screen_name": "twitter",
|
||||||
"name": "Twitter",
|
"name": "Twitter",
|
||||||
"id": 1
|
"id": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"screen_name": "seepicturely",
|
|
||||||
"name": "Seepicturely",
|
|
||||||
"id": 2
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"screen_name": "boscomonkey",
|
"screen_name": "boscomonkey",
|
||||||
"name": "Bosco So",
|
"name": "Bosco So",
|
||||||
"id": 3
|
"id": 2
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"screen_name": "episod",
|
"screen_name": "episod",
|
||||||
"name": "Taylor Singletary",
|
"name": "Taylor Singletary",
|
||||||
"id": 4
|
"id": 3
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"urls": [
|
"urls": [
|
||||||
@@ -95,63 +75,43 @@ NORMAL_TWEET = """{
|
|||||||
}"""
|
}"""
|
||||||
|
|
||||||
MENTION_IN_LINK_TWEET = """{
|
MENTION_IN_LINK_TWEET = """{
|
||||||
"coordinates": null,
|
|
||||||
"created_at": "Sat Sep 10 22:23:38 +0000 2011",
|
"created_at": "Sat Sep 10 22:23:38 +0000 2011",
|
||||||
"truncated": false,
|
|
||||||
"favorited": false,
|
|
||||||
"id_str": "112652479837110273",
|
"id_str": "112652479837110273",
|
||||||
"in_reply_to_user_id_str": "783214",
|
"in_reply_to_user_id_str": "783214",
|
||||||
"text": "http://t.co/@foo",
|
"text": "http://t.co/@foo",
|
||||||
"contributors": null,
|
"source": "<a href=\\"http://twitter.com\\" rel=\\"nofollow\\">Twitter Web Client</a>",
|
||||||
|
"lang": "en",
|
||||||
"id": 112652479837110273,
|
"id": 112652479837110273,
|
||||||
"retweet_count": 0,
|
|
||||||
"in_reply_to_status_id_str": null,
|
|
||||||
"geo": null,
|
|
||||||
"retweeted": false,
|
|
||||||
"possibly_sensitive": false,
|
|
||||||
"in_reply_to_user_id": 783214,
|
"in_reply_to_user_id": 783214,
|
||||||
|
"favorite_count": 3,
|
||||||
"user": {
|
"user": {
|
||||||
"profile_sidebar_border_color": "eeeeee",
|
|
||||||
"profile_background_tile": true,
|
|
||||||
"profile_sidebar_fill_color": "efefef",
|
"profile_sidebar_fill_color": "efefef",
|
||||||
"name": "Eoin McMillan ",
|
"name": "Eoin McMillan ",
|
||||||
"profile_image_url": "http://a1.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
"profile_image_url": "http://a1.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
||||||
"created_at": "Mon May 16 20:07:59 +0000 2011",
|
"created_at": "Mon May 16 20:07:59 +0000 2011",
|
||||||
"location": "Twitter",
|
"location": "Twitter",
|
||||||
"profile_link_color": "009999",
|
"profile_link_color": "009999",
|
||||||
"follow_request_sent": null,
|
|
||||||
"is_translator": false,
|
|
||||||
"id_str": "299862462",
|
"id_str": "299862462",
|
||||||
"favourites_count": 0,
|
"favourites_count": 0,
|
||||||
"default_profile": false,
|
|
||||||
"url": "http://www.eoin.me",
|
"url": "http://www.eoin.me",
|
||||||
"contributors_enabled": false,
|
|
||||||
"id": 299862462,
|
"id": 299862462,
|
||||||
"utc_offset": null,
|
"utc_offset": null,
|
||||||
"profile_image_url_https": "https://si0.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
"profile_image_url_https": "https://si0.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
||||||
"profile_use_background_image": true,
|
|
||||||
"listed_count": 0,
|
"listed_count": 0,
|
||||||
"followers_count": 9,
|
"followers_count": 9,
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"profile_text_color": "333333",
|
"profile_text_color": "333333",
|
||||||
"protected": false,
|
|
||||||
"profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme14/bg.gif",
|
"profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme14/bg.gif",
|
||||||
"description": "Eoin's photography account. See @mceoin for tweets.",
|
"description": "Eoin's photography account. See @mceoin for tweets.",
|
||||||
"geo_enabled": false,
|
"geo_enabled": false,
|
||||||
"verified": false,
|
|
||||||
"profile_background_color": "131516",
|
"profile_background_color": "131516",
|
||||||
"time_zone": null,
|
"time_zone": null,
|
||||||
"notifications": null,
|
|
||||||
"statuses_count": 255,
|
"statuses_count": 255,
|
||||||
"friends_count": 0,
|
"friends_count": 0,
|
||||||
"default_profile_image": false,
|
|
||||||
"profile_background_image_url": "http://a1.twimg.com/images/themes/theme14/bg.gif",
|
"profile_background_image_url": "http://a1.twimg.com/images/themes/theme14/bg.gif",
|
||||||
"screen_name": "imeoin",
|
"screen_name": "imeoin",
|
||||||
"following": null,
|
"statuses_count": 270
|
||||||
"show_all_inline_media": false
|
|
||||||
},
|
},
|
||||||
"in_reply_to_screen_name": "twitter",
|
|
||||||
"in_reply_to_status_id": null,
|
|
||||||
"user_mentions": [
|
"user_mentions": [
|
||||||
{
|
{
|
||||||
"screen_name": "foo",
|
"screen_name": "foo",
|
||||||
@@ -168,70 +128,48 @@ MENTION_IN_LINK_TWEET = """{
|
|||||||
}"""
|
}"""
|
||||||
|
|
||||||
MEDIA_TWEET = """{
|
MEDIA_TWEET = """{
|
||||||
"coordinates": null,
|
|
||||||
"created_at": "Sat Sep 10 22:23:38 +0000 2011",
|
"created_at": "Sat Sep 10 22:23:38 +0000 2011",
|
||||||
"truncated": false,
|
|
||||||
"favorited": false,
|
|
||||||
"id_str": "112652479837110273",
|
"id_str": "112652479837110273",
|
||||||
"in_reply_to_user_id_str": "783214",
|
"in_reply_to_user_id_str": "783214",
|
||||||
"text": "http://t.co/xo7pAhK6n3",
|
"text": "http://t.co/xo7pAhK6n3",
|
||||||
"contributors": null,
|
"source": "<a href=\\"http://twitter.com\\" rel=\\"nofollow\\">Twitter Web Client</a>",
|
||||||
|
"lang": "en",
|
||||||
"id": 112652479837110273,
|
"id": 112652479837110273,
|
||||||
"retweet_count": 0,
|
|
||||||
"in_reply_to_status_id_str": null,
|
|
||||||
"geo": null,
|
|
||||||
"retweeted": false,
|
|
||||||
"possibly_sensitive": false,
|
|
||||||
"in_reply_to_user_id": 783214,
|
"in_reply_to_user_id": 783214,
|
||||||
|
"favorite_count": 3,
|
||||||
"user": {
|
"user": {
|
||||||
"profile_sidebar_border_color": "eeeeee",
|
|
||||||
"profile_background_tile": true,
|
|
||||||
"profile_sidebar_fill_color": "efefef",
|
"profile_sidebar_fill_color": "efefef",
|
||||||
"name": "Eoin McMillan ",
|
"name": "Eoin McMillan ",
|
||||||
"profile_image_url": "http://a1.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
"profile_image_url": "http://a1.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
||||||
"created_at": "Mon May 16 20:07:59 +0000 2011",
|
"created_at": "Mon May 16 20:07:59 +0000 2011",
|
||||||
"location": "Twitter",
|
"location": "Twitter",
|
||||||
"profile_link_color": "009999",
|
"profile_link_color": "009999",
|
||||||
"follow_request_sent": null,
|
|
||||||
"is_translator": false,
|
|
||||||
"id_str": "299862462",
|
"id_str": "299862462",
|
||||||
"favourites_count": 0,
|
"favourites_count": 0,
|
||||||
"default_profile": false,
|
|
||||||
"url": "http://www.eoin.me",
|
"url": "http://www.eoin.me",
|
||||||
"contributors_enabled": false,
|
|
||||||
"id": 299862462,
|
"id": 299862462,
|
||||||
"utc_offset": null,
|
"utc_offset": null,
|
||||||
"profile_image_url_https": "https://si0.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
"profile_image_url_https": "https://si0.twimg.com/profile_images/1380912173/Screen_shot_2011-06-03_at_7.35.36_PM_normal.png",
|
||||||
"profile_use_background_image": true,
|
|
||||||
"listed_count": 0,
|
"listed_count": 0,
|
||||||
"followers_count": 9,
|
"followers_count": 9,
|
||||||
"lang": "en",
|
"lang": "en",
|
||||||
"profile_text_color": "333333",
|
"profile_text_color": "333333",
|
||||||
"protected": false,
|
|
||||||
"profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme14/bg.gif",
|
"profile_background_image_url_https": "https://si0.twimg.com/images/themes/theme14/bg.gif",
|
||||||
"description": "Eoin's photography account. See @mceoin for tweets.",
|
"description": "Eoin's photography account. See @mceoin for tweets.",
|
||||||
"geo_enabled": false,
|
"geo_enabled": false,
|
||||||
"verified": false,
|
|
||||||
"profile_background_color": "131516",
|
"profile_background_color": "131516",
|
||||||
"time_zone": null,
|
"time_zone": null,
|
||||||
"notifications": null,
|
|
||||||
"statuses_count": 255,
|
"statuses_count": 255,
|
||||||
"friends_count": 0,
|
"friends_count": 0,
|
||||||
"default_profile_image": false,
|
|
||||||
"profile_background_image_url": "http://a1.twimg.com/images/themes/theme14/bg.gif",
|
"profile_background_image_url": "http://a1.twimg.com/images/themes/theme14/bg.gif",
|
||||||
"screen_name": "imeoin",
|
"screen_name": "imeoin",
|
||||||
"following": null,
|
"statuses_count": 270
|
||||||
"show_all_inline_media": false
|
|
||||||
},
|
},
|
||||||
"in_reply_to_screen_name": "twitter",
|
|
||||||
"in_reply_to_status_id": null,
|
|
||||||
"media": [
|
"media": [
|
||||||
{
|
{
|
||||||
"display_url": "pic.twitter.com/xo7pAhK6n3",
|
"display_url": "pic.twitter.com/xo7pAhK6n3",
|
||||||
"expanded_url": "http://twitter.com/NEVNBoston/status/421654515616849920/photo/1",
|
"expanded_url": "http://twitter.com/NEVNBoston/status/421654515616849920/photo/1",
|
||||||
"id": 421654515495211010,
|
"id": 421654515495211010,
|
||||||
"id_str": "421654515495211010",
|
|
||||||
"indices": [121, 143],
|
|
||||||
"media_url": "http://pbs.twimg.com/media/BdoEjD4IEAIq86Z.jpg",
|
"media_url": "http://pbs.twimg.com/media/BdoEjD4IEAIq86Z.jpg",
|
||||||
"media_url_https": "https://pbs.twimg.com/media/BdoEjD4IEAIq86Z.jpg",
|
"media_url_https": "https://pbs.twimg.com/media/BdoEjD4IEAIq86Z.jpg",
|
||||||
"sizes": {"large": {"h": 700, "resize": "fit", "w": 1024},
|
"sizes": {"large": {"h": 700, "resize": "fit", "w": 1024},
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ class BugdownTest(TestCase):
|
|||||||
def make_link(url):
|
def make_link(url):
|
||||||
return '<a href="%s" target="_blank" title="%s">%s</a>' % (url, url, url)
|
return '<a href="%s" target="_blank" title="%s">%s</a>' % (url, url, url)
|
||||||
|
|
||||||
normal_tweet_html = """<a href="https://twitter.com/twitter" target="_blank" title="https://twitter.com/twitter">@twitter</a> meets <a href="https://twitter.com/seepicturely" target="_blank" title="https://twitter.com/seepicturely">@seepicturely</a> at #tcdisrupt cc.<a href="https://twitter.com/boscomonkey" target="_blank" title="https://twitter.com/boscomonkey">@boscomonkey</a> <a href="https://twitter.com/episod" target="_blank" title="https://twitter.com/episod">@episod</a> <a href="http://t.co/6J2EgYM" target="_blank" title="http://t.co/6J2EgYM">http://instagram.com/p/MuW67/</a>"""
|
normal_tweet_html = """<a href="https://twitter.com/twitter" target="_blank" title="https://twitter.com/twitter">@twitter</a> meets @seepicturely at #tcdisrupt cc.<a href="https://twitter.com/boscomonkey" target="_blank" title="https://twitter.com/boscomonkey">@boscomonkey</a> <a href="https://twitter.com/episod" target="_blank" title="https://twitter.com/episod">@episod</a> <a href="http://t.co/6J2EgYM" target="_blank" title="http://t.co/6J2EgYM">http://instagram.com/p/MuW67/</a>"""
|
||||||
|
|
||||||
mention_in_link_tweet_html = """<a href="http://t.co/@foo" target="_blank" title="http://t.co/@foo">http://foo.com</a>"""
|
mention_in_link_tweet_html = """<a href="http://t.co/@foo" target="_blank" title="http://t.co/@foo">http://foo.com</a>"""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user