| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.stocktwits.provider import StocktwitsProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class StocktwitsTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = StocktwitsProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return MockedResponse( |
| 15 |
HTTPStatus.OK, |
| 16 |
""" |
| 17 |
{ |
| 18 |
"response": { |
| 19 |
"status": 200 |
| 20 |
}, |
| 21 |
"user": { |
| 22 |
"id": 3, |
| 23 |
"username": "zerobeta", |
| 24 |
"name": "Justin Paterno", |
| 25 |
"avatar_url": "http://avatars.stocktwits.com/images/default_avatar_thumb.jpg", |
| 26 |
"avatar_url_ssl": "https://s3.amazonaws.com/st-avatars/images/default_avatar_thumb.jpg", |
| 27 |
"identity": "Official", |
| 28 |
"classification": [ |
| 29 |
"ir" |
| 30 |
] |
| 31 |
} |
| 32 |
} |
| 33 |
""", |
| 34 |
) # noqa |
| 35 |
|
| 36 |
def get_expected_to_str(self): |
| 37 |
return "zerobeta" |