| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.box.provider import BoxOAuth2Provider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class BoxOAuth2Tests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = BoxOAuth2Provider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return [ |
| 15 |
MockedResponse( |
| 16 |
HTTPStatus.OK, |
| 17 |
"""{ |
| 18 |
"type": "user", |
| 19 |
"id": "1185237519", |
| 20 |
"name": "Balls Johnson", |
| 21 |
"login": "[email protected]", |
| 22 |
"created_at": "2017-02-18T21:16:39-08:00", |
| 23 |
"modified_at": "2017-02-18T21:19:11-08:00", |
| 24 |
"language": "en", |
| 25 |
"timezone": "America/Los_Angeles", |
| 26 |
"space_amount": 10737418240, |
| 27 |
"space_used": 0, |
| 28 |
"max_upload_size": 2147483648, |
| 29 |
"status": "active", |
| 30 |
"job_title": "", |
| 31 |
"phone": "123-345-5555", |
| 32 |
"address": "", |
| 33 |
"avatar_url": "https://app.box.com/api/avatar/large/1185237519" |
| 34 |
}""", |
| 35 |
) |
| 36 |
] |
| 37 |
|
| 38 |
def get_expected_to_str(self): |
| 39 |
return "[email protected]" |