| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.zoom.provider import ZoomProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class ZoomTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = ZoomProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return MockedResponse( |
| 15 |
HTTPStatus.OK, |
| 16 |
""" |
| 17 |
{ |
| 18 |
"id": "KdYKjnimT4KPd8FFgQt9FQ", |
| 19 |
"first_name": "Jane", |
| 20 |
"last_name": "Dev", |
| 21 |
"email": "[email protected]", |
| 22 |
"type": 2, |
| 23 |
"role_name": "Owner", |
| 24 |
"pmi": 1234567890, |
| 25 |
"use_pmi": false, |
| 26 |
"vanity_url": "https://janedevinc.zoom.us/my/janedev", |
| 27 |
"personal_meeting_url": "https://janedevinc.zoom.us/j/1234567890", |
| 28 |
"timezone": "America/Denver", |
| 29 |
"verified": 1, |
| 30 |
"dept": "", |
| 31 |
"created_at": "2019-04-05T15:24:32Z", |
| 32 |
"last_login_time": "2019-12-16T18:02:48Z", |
| 33 |
"last_client_version": "4.6.12611.1124(mac)", |
| 34 |
"pic_url": "https://janedev.zoom.us/p/KdYKjnimFR5Td8KKdQt9FQ/19f6430f-...", |
| 35 |
"host_key": "533895", |
| 36 |
"jid": "[email protected]", |
| 37 |
"group_ids": [], |
| 38 |
"im_group_ids": [ |
| 39 |
"3NXCD9VFTCOUH8LD-QciGw" |
| 40 |
], |
| 41 |
"account_id": "gVcjZnYYRLDbb_MfgHuaxg", |
| 42 |
"language": "en-US", |
| 43 |
"phone_country": "US", |
| 44 |
"phone_number": "+1 1234567891", |
| 45 |
"status": "active" |
| 46 |
} |
| 47 |
""", |
| 48 |
) |
| 49 |
|
| 50 |
def get_expected_to_str(self): |
| 51 |
return "[email protected]" |