| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.yahoo.provider import YahooProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class YahooTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = YahooProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
response_data = """ |
| 15 |
{ |
| 16 |
"sub": "FSVIDUW3D7FSVIDUW3D72F2F", |
| 17 |
"name": "Jane Doe", |
| 18 |
"given_name": "Jane", |
| 19 |
"family_name": "Doe", |
| 20 |
"preferred_username": "j.doe", |
| 21 |
"email": "[email protected]", |
| 22 |
"email_verified": true, |
| 23 |
"picture": "http://example.com/janedoe/me.jpg" |
| 24 |
} |
| 25 |
""" # noqa |
| 26 |
return MockedResponse(HTTPStatus.OK, response_data) |
| 27 |
|
| 28 |
def get_expected_to_str(self): |
| 29 |
return "[email protected]" |