| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.exist.provider import ExistProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class ExistTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = ExistProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return MockedResponse( |
| 15 |
HTTPStatus.OK, |
| 16 |
""" |
| 17 |
{ |
| 18 |
"id": 1, |
| 19 |
"username": "josh", |
| 20 |
"first_name": "Josh", |
| 21 |
"last_name": "Sharp", |
| 22 |
"bio": "I made this thing you're using.", |
| 23 |
"url": "http://hellocode.co/", |
| 24 |
"avatar": "https://exist.io/static/media/avatars/josh_2.png", |
| 25 |
"timezone": "Australia/Melbourne", |
| 26 |
"local_time": "2020-07-31T22:33:49.359+10:00", |
| 27 |
"private": false, |
| 28 |
"imperial_units": false, |
| 29 |
"imperial_distance": false, |
| 30 |
"imperial_weight": false, |
| 31 |
"imperial_energy": false, |
| 32 |
"imperial_liquid": false, |
| 33 |
"imperial_temperature": false, |
| 34 |
"attributes": [] |
| 35 |
} |
| 36 |
""", |
| 37 |
) |
| 38 |
|
| 39 |
def get_expected_to_str(self): |
| 40 |
return "josh" |