| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.xing.provider import XingProvider |
| 6 |
from tests.apps.socialaccount.base import OAuthTestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class XingTests(OAuthTestsMixin, TestCase): |
| 11 |
provider_id = XingProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return [ |
| 15 |
MockedResponse( |
| 16 |
HTTPStatus.OK, |
| 17 |
""" |
| 18 |
{"users":[{"id":"20493333_1cd028","active_email":"[email protected]", |
| 19 |
"badges":[],"birth_date":{"year":null,"month":null,"day":null}, |
| 20 |
"business_address":{"street":null,"zip_code":null,"city":null,"province":null, |
| 21 |
"country":"NL","email":null,"fax":null,"phone":null,"mobile_phone":null}, |
| 22 |
"display_name":"Raymond Penners","educational_background": |
| 23 |
{"primary_school_id":null,"schools":[],"qualifications":[]}, |
| 24 |
"employment_status":"EMPLOYEE","first_name":"Raymond","gender":"m", |
| 25 |
"haves":null,"instant_messaging_accounts":{},"interests":null,"languages": |
| 26 |
{"nl":null},"last_name":"Penners","organisation_member":null, |
| 27 |
"page_name":"Raymond_Penners", |
| 28 |
"permalink":"https://www.xing.com/profile/Raymond_Penners", |
| 29 |
"photo_urls":{"thumb":"https://www.xing.com/img/n/nobody_m.30x40.jpg", |
| 30 |
"large":"https://www.xing.com/img/n/nobody_m.140x185.jpg","mini_thumb": |
| 31 |
"https://www.xing.com/img/n/nobody_m.18x24.jpg","maxi_thumb": |
| 32 |
"https://www.xing.com/img/n/nobody_m.70x93.jpg","medium_thumb": |
| 33 |
"https://www.xing.com/img/n/nobody_m.57x75.jpg"},"premium_services":[], |
| 34 |
"private_address":{"street":null,"zip_code":null,"city":null,"province":null, |
| 35 |
"country":null,"email":"[email protected]","fax":null, |
| 36 |
"phone":null,"mobile_phone":null},"professional_experience": |
| 37 |
{"primary_company":{"name":null,"url":null,"tag":null,"title":null, |
| 38 |
"begin_date":null,"end_date":null,"description":null,"industry":"OTHERS", |
| 39 |
"company_size":null,"career_level":null},"non_primary_companies":[], |
| 40 |
"awards":[]},"time_zone":{"utc_offset":2.0,"name":"Europe/Berlin"}, |
| 41 |
"wants":null,"web_profiles":{}}]} |
| 42 |
|
| 43 |
""", |
| 44 |
) |
| 45 |
] |
| 46 |
|
| 47 |
def get_expected_to_str(self): |
| 48 |
return "[email protected]" |