| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.naver.provider import NaverProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class NaverTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = NaverProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return MockedResponse( |
| 15 |
HTTPStatus.OK, |
| 16 |
""" |
| 17 |
{ |
| 18 |
"response": |
| 19 |
{ |
| 20 |
"enc_id": "46111c25f969116de4e545f13a415bb5383db2a79782da8851db72b2cced3180", |
| 21 |
"nickname": "\ubc31\ud638", |
| 22 |
"profile_image": |
| 23 |
"https://ssl.pstatic.net/static/pwe/address/nodata_33x33.gif", |
| 24 |
"gender": "M", |
| 25 |
"id": "7163491", |
| 26 |
"age": "20-29", |
| 27 |
"birthday": "03-22", |
| 28 |
"email": "[email protected]", |
| 29 |
"name": "\uc774\uc0c1\ud601" |
| 30 |
}, |
| 31 |
"message": "success", |
| 32 |
"resultcode": "00" |
| 33 |
} |
| 34 |
""", |
| 35 |
) |
| 36 |
|
| 37 |
def get_expected_to_str(self): |
| 38 |
return "[email protected]" |