| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.meetup.provider import MeetupProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class MeetupTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = MeetupProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return MockedResponse( |
| 15 |
HTTPStatus.OK, |
| 16 |
""" |
| 17 |
{"id": 1, "lang": "en_US", "city": "Bhubaneswar", |
| 18 |
"photo": { |
| 19 |
"thumb_link":"", |
| 20 |
"photo_id": 240057062, |
| 21 |
"highres_link":"", |
| 22 |
"base_url": "http://photos2.meetupstatic.com", |
| 23 |
"type": "member", |
| 24 |
"name": "Abhishek Jaiswal", "other_services": {}, |
| 25 |
"country": "in", "topics": [{"name": "Open Source", |
| 26 |
"urlkey": "opensource", "id": 563}, {"name": "Python", "urlkey": |
| 27 |
"python", "id": 1064}, {"name": "Software Development", "urlkey": |
| 28 |
"softwaredev", "id": 3833}, {"name": "Computer programming", |
| 29 |
"urlkey": "computer-programming", "id": 48471}, |
| 30 |
{"name": "Python Web Development", |
| 31 |
"urlkey": "python-web-development", "id": 917242}, |
| 32 |
{"name": "Data Science using Python", |
| 33 |
"urlkey": "data-science-using-python", "id": 1481522}], |
| 34 |
"lon": 85.83999633789062, "joined": 1411642310000, |
| 35 |
"id": 173662372, "status": "active", |
| 36 |
"link": "http://www.meetup.com/members/173662372", |
| 37 |
"hometown": "Kolkata", "lat": 20.270000457763672, |
| 38 |
"visited": 1488829924000, "self": {"common": {}}}}""", |
| 39 |
) |
| 40 |
|
| 41 |
def get_expected_to_str(self): |
| 42 |
return "Meetup" |