Debian Codegraph @

tests/apps/socialaccount/providers/hubspot/tests.py

raw
1 from http import HTTPStatus
2
3 from django.test import TestCase
4
5 from allauth.socialaccount.providers.hubspot.provider import HubspotProvider
6 from tests.apps.socialaccount.base import OAuth2TestsMixin
7 from tests.mocking import MockedResponse
8
9
10 class HubspotTests(OAuth2TestsMixin, TestCase):
11 provider_id = HubspotProvider.id
12
13 def get_mocked_response(self):
14 return MockedResponse(
15 HTTPStatus.OK,
16 """{
17 "token": "CNye4dqFMBICAAEYhOKlDZZ_z6IVKI_xMjIUgmFsNQzgBjNE9YBmhAhNOtfN0ak6BAAAAEFCFIIwn2EVRLpvJI9hP4tbIeKHw7ZXSgNldTFSAFoA",
18 "user": "[email protected]",
19 "hub_domain": "acme.com",
20 "scopes": ["oauth"],
21 "scope_to_scope_group_pks": [25, 31],
22 "trial_scopes": [],
23 "trial_scope_to_scope_group_pks": [],
24 "hub_id": 211580,
25 "app_id": 833572,
26 "expires_in": 1799,
27 "user_id": 42607123,
28 "token_type": "access"
29 }""",
30 )
31
32 def get_expected_to_str(self):
33 return "[email protected]"