| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.edmodo.provider import EdmodoProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class EdmodoTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = EdmodoProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return MockedResponse( |
| 15 |
HTTPStatus.OK, |
| 16 |
""" |
| 17 |
{ |
| 18 |
"url": "https://api.edmodo.com/users/74721257", |
| 19 |
"id": 74721257, |
| 20 |
"type": "teacher", |
| 21 |
"username": "getacclaim-teacher1", |
| 22 |
"user_title": null, |
| 23 |
"first_name": "Edmodo Test", |
| 24 |
"last_name": "Teacher", |
| 25 |
"time_zone": "America/New_York", |
| 26 |
"utc_offset": -18000, |
| 27 |
"locale": "en", |
| 28 |
"gender": null, |
| 29 |
"start_level": null, |
| 30 |
"end_level": null, |
| 31 |
"about": null, |
| 32 |
"premium": false, |
| 33 |
"school": {"url": "https://api.edmodo.com/schools/559253", "id": 559253}, |
| 34 |
"verified_institution_member": true, |
| 35 |
"coppa_verified": false, |
| 36 |
"subjects": null, |
| 37 |
"avatars": { |
| 38 |
"small": |
| 39 |
"https://api.edmodo.com/users/74721257/avatar?type=small&u=670329ncqnf8fxv7tya24byn5", |
| 40 |
"large": |
| 41 |
"https://api.edmodo.com/users/74721257/avatar?type=large&u=670329ncqnf8fxv7tya24byn5" |
| 42 |
}, |
| 43 |
"email":"[email protected]", |
| 44 |
"sync_enabled": false |
| 45 |
} |
| 46 |
""", |
| 47 |
) # noqa |
| 48 |
|
| 49 |
def get_expected_to_str(self): |
| 50 |
return "getacclaim-teacher1" |