| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.coinbase.provider import CoinbaseProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class CoinbaseTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = CoinbaseProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return MockedResponse( |
| 15 |
HTTPStatus.OK, |
| 16 |
"""{ |
| 17 |
"id": "9da7a204-544e-5fd1-9a12-61176c5d4cd8", |
| 18 |
"name": "User One", |
| 19 |
"username": "user1", |
| 20 |
"email": "[email protected]", |
| 21 |
"profile_location": null, |
| 22 |
"profile_bio": null, |
| 23 |
"profile_url": "https://coinbase.com/user1", |
| 24 |
"avatar_url": "https://images.coinbase.com/avatar?h=vR%2FY8igBoPwuwGren5JMwvDNGpURAY%2F0nRIOgH%2FY2Qh%2BQ6nomR3qusA%2Bh6o2%0Af9rH&s=128", |
| 25 |
"resource": "user", |
| 26 |
"resource_path": "/v2/user" |
| 27 |
}""", |
| 28 |
) |
| 29 |
|
| 30 |
def get_expected_to_str(self): |
| 31 |
return "user1" |