Debian Codegraph @

tests/apps/socialaccount/providers/tiktok/tests.py

raw
1 from http import HTTPStatus
2
3 from django.test import TestCase
4
5 from allauth.socialaccount.providers.tiktok.provider import TikTokProvider
6 from tests.apps.socialaccount.base import OAuth2TestsMixin
7 from tests.mocking import MockedResponse
8
9
10 class TikTokTests(OAuth2TestsMixin, TestCase):
11 provider_id = TikTokProvider.id
12
13 def get_mocked_response(self):
14 return MockedResponse(
15 HTTPStatus.OK,
16 """
17 {
18 "data": {
19 "user": {
20 "open_id": "44322889",
21 "username": "username123",
22 "display_name": "Nice Display Name",
23 "avatar_url": "https://example.com/avatar.jpg",
24 "profile_deep_link": "https://example.com/profile"
25 }
26 }
27 }
28 """,
29 )
30
31 def get_expected_to_str(self):
32 return "username123"