| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.atlassian.provider import AtlassianProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class AtlassianTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = AtlassianProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
response_data = """ |
| 15 |
{ |
| 16 |
"account_type": "atlassian", |
| 17 |
"account_id": "112233aa-bb11-cc22-33dd-445566abcabc", |
| 18 |
"email": "[email protected]", |
| 19 |
"email_verified": true, |
| 20 |
"name": "Mia Krystof", |
| 21 |
"picture": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/112233aa-bb11-cc22-33dd-445566abcabc/1234abcd-9876-54aa-33aa-1234dfsade9487ds", |
| 22 |
"account_status": "active", |
| 23 |
"nickname": "mkrystof", |
| 24 |
"zoneinfo": "Australia/Sydney", |
| 25 |
"locale": "en-US", |
| 26 |
"extended_profile": { |
| 27 |
"job_title": "Designer", |
| 28 |
"organization": "[email protected]", |
| 29 |
"department": "Design team", |
| 30 |
"location": "Sydney" |
| 31 |
} |
| 32 |
}""" |
| 33 |
return MockedResponse(HTTPStatus.OK, response_data) |
| 34 |
|
| 35 |
def get_expected_to_str(self): |
| 36 |
return "[email protected]" |