| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.vimeo.provider import VimeoProvider |
| 6 |
from tests.apps.socialaccount.base import OAuthTestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class VimeoTests(OAuthTestsMixin, TestCase): |
| 11 |
provider_id = VimeoProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return [ |
| 15 |
MockedResponse( |
| 16 |
HTTPStatus.OK, |
| 17 |
""" |
| 18 |
{"generated_in":"0.0137", |
| 19 |
"stat":"ok","person":{ |
| 20 |
"created_on": "2013-04-08 14:24:47", |
| 21 |
"id":"17574504", |
| 22 |
"is_contact":"0", |
| 23 |
"is_plus":"0","is_pro":"0","is_staff":"0","is_subscribed_to":"0", |
| 24 |
"username":"user17574504","display_name":"Raymond Penners","location":"", |
| 25 |
"url":[""],"bio":"","number_of_contacts":"0","number_of_uploads":"0", |
| 26 |
"number_of_likes":"0","number_of_videos":"0", |
| 27 |
"number_of_videos_appears_in":"0","number_of_albums":"0", |
| 28 |
"number_of_channels":"0","number_of_groups":"0", |
| 29 |
"profileurl":"http:\\/\\/vimeo.com\\/user17574504", |
| 30 |
"videosurl":"http:\\/\\/vimeo.com\\/user17574504\\/videos", |
| 31 |
"portraits":{"portrait":[{"height":"30","width":"30", |
| 32 |
"_content": |
| 33 |
"http:\\/\\/a.vimeocdn.com\\/images_v6\\/portraits\\/portrait_30_yellow.png"}, |
| 34 |
{"height":"75","width":"75","_content": |
| 35 |
"http:\\/\\/a.vimeocdn.com\\/images_v6\\/portraits\\/portrait_75_yellow.png"}, |
| 36 |
{"height":"100","width":"100","_content": |
| 37 |
"http:\\/\\/a.vimeocdn.com\\/images_v6\\/portraits\\/portrait_100_yellow.png"}, |
| 38 |
{"height":"300","width":"300","_content": |
| 39 |
"http:\\/\\/a.vimeocdn.com\\/images_v6\\/portraits\\/portrait_300_yellow.png"}]}}} |
| 40 |
""", |
| 41 |
) |
| 42 |
] |
| 43 |
|
| 44 |
def get_expected_to_str(self): |
| 45 |
return "user17574504" |