| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.gumroad.provider import GumroadProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class GumroadTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = GumroadProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return MockedResponse( |
| 15 |
HTTPStatus.OK, |
| 16 |
"""{ |
| 17 |
"success": true, |
| 18 |
"user": { |
| 19 |
"bio": "a sailor, a tailor", |
| 20 |
"name": "John Smith", |
| 21 |
"twitter_handle": null, |
| 22 |
"user_id": "G_-mnBf9b1j9A7a4ub4nFQ==", |
| 23 |
"email": "[email protected]", |
| 24 |
"url": "https://gumroad.com/sailorjohn" |
| 25 |
} |
| 26 |
}""", |
| 27 |
) |
| 28 |
|
| 29 |
def get_expected_to_str(self): |
| 30 |
return "[email protected]" |