| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.vimeo_oauth2.provider import VimeoOAuth2Provider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class VimeoOAuth2Tests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = VimeoOAuth2Provider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return MockedResponse( |
| 15 |
HTTPStatus.OK, |
| 16 |
"""{ |
| 17 |
"uri": "/users/12345", |
| 18 |
"name": "AllAuth", |
| 19 |
"link": "https://vimeo.com/user12345", |
| 20 |
"created_time": "2012-06-04T00:02:16+00:00", |
| 21 |
"pictures": { |
| 22 |
"uri": null, |
| 23 |
"active": false, |
| 24 |
"type": "default", |
| 25 |
"sizes": [{ |
| 26 |
"width": 30, |
| 27 |
"height": 30, |
| 28 |
"link": "https://i.vimeocdn.com/portrait/defaults-blue_30x30.png" |
| 29 |
}], |
| 30 |
"resource_key": "1234567890abcdef" |
| 31 |
}, |
| 32 |
"resource_key": "1234567890abcdef", |
| 33 |
"account": "pro" |
| 34 |
}""", |
| 35 |
) # noqa |
| 36 |
|
| 37 |
def get_expected_to_str(self): |
| 38 |
return "AllAuth" |