| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.weibo.provider import WeiboProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class WeiboTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = WeiboProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return MockedResponse( |
| 15 |
HTTPStatus.OK, |
| 16 |
""" |
| 17 |
{"bi_followers_count": 0, |
| 18 |
"domain": "", "avatar_large": "http://tp3.sinaimg.cn/3195025850/180/0/0", |
| 19 |
"block_word": 0, "star": 0, "id": 3195025850, "city": "1", "verified": false, |
| 20 |
"follow_me": false, "verified_reason": "", "followers_count": 6, |
| 21 |
"location": "\u5317\u4eac \u4e1c\u57ce\u533a", "mbtype": 0, |
| 22 |
"profile_url": "u/3195025850", "province": "11", "statuses_count": 0, |
| 23 |
"description": "", "friends_count": 0, "online_status": 0, "mbrank": 0, |
| 24 |
"idstr": "3195025850", |
| 25 |
"profile_image_url": "http://tp3.sinaimg.cn/3195025850/50/0/0", |
| 26 |
"allow_all_act_msg": false, "allow_all_comment": true, "geo_enabled": true, |
| 27 |
"name": "pennersr", "lang": "zh-cn", "weihao": "", "remark": "", |
| 28 |
"favourites_count": 0, "screen_name": "pennersr", "url": "", "gender": "f", |
| 29 |
"created_at": "Tue Feb 19 19:43:39 +0800 2013", "verified_type": -1, |
| 30 |
"following": false} |
| 31 |
|
| 32 |
""", |
| 33 |
) |
| 34 |
|
| 35 |
def get_expected_to_str(self): |
| 36 |
return "pennersr" |