def test_weibo_request(self):
"""
:return:
"""
body = """
{"next_cursor": 4098746105417334, "hasvisible": false, "uve_blank": -1, "statuses": ["4098748692646689",
"4098748689403910", "4098748688918202", "4098747640117551", "4098747434341769", "4098747430814353",
"4098747430145399", "4098747052681634", "4098746357066702", "4098746322855226", "4098746297959121",
"4098746251989195", "4098746226771596", "4098746205413046", "4098746180805829", "4098746175979920",
"4098746172045575", "4098746172045403", "4098746160243131", "4098746139219122"], "ad": [],
"advertises": [], "interval": 0, "previous_cursor": 0, "total_number": 1322}
"""
httpretty.register_uri(
httpretty.GET, "https://api.weibo.com/2/statuses/friends_timeline/ids.json",
body=body,
status=200,
content_type='text/json'
)
self.assertDictEqual(self.client.get("statuses/friends_timeline/ids.json"), json.loads(body))
评论列表
文章目录