Debian Codegraph @

tests/apps/socialaccount/providers/soundcloud/tests.py

raw
1 from http import HTTPStatus
2
3 from django.test import TestCase
4
5 from allauth.socialaccount.providers.soundcloud.provider import SoundCloudProvider
6 from tests.apps.socialaccount.base import OAuth2TestsMixin
7 from tests.mocking import MockedResponse
8
9
10 class SoundCloudTests(OAuth2TestsMixin, TestCase):
11 provider_id = SoundCloudProvider.id
12
13 def get_mocked_response(self):
14 return MockedResponse(
15 HTTPStatus.OK,
16 """
17 {
18 "website": null,
19 "myspace_name": null,
20 "public_favorites_count": 0,
21 "followings_count": 1,
22 "full_name": "",
23 "urn": "soundcloud:users:22341947",
24 "city": null,
25 "track_count": 0,
26 "playlist_count": 0,
27 "discogs_name": null,
28 "private_tracks_count": 0,
29 "followers_count": 0,
30 "online": true,
31 "username": "user187631676",
32 "description": null,
33 "kind": "user",
34 "website_title": null,
35 "primary_email_confirmed": false,
36 "permalink_url": "http://soundcloud.com/user187631676",
37 "private_playlists_count": 0,
38 "permalink": "user187631676",
39 "country": null,
40 "uri": "https://api.soundcloud.com/users/22341947",
41 "avatar_url":
42 "https://a1.sndcdn.com/images/default_avatar_large.png?4b4189b",
43 "plan": "Free"
44 }""",
45 )
46
47 def get_expected_to_str(self):
48 return "user187631676"