Debian Codegraph @

tests/apps/socialaccount/providers/okta/tests.py

raw
1 from http import HTTPStatus
2
3 from django.test import TestCase
4
5 from allauth.socialaccount.providers.okta.provider import OktaProvider
6 from tests.apps.socialaccount.base import OAuth2TestsMixin
7 from tests.mocking import MockedResponse
8
9
10 class OktaTests(OAuth2TestsMixin, TestCase):
11 provider_id = OktaProvider.id
12
13 def get_mocked_response(self):
14 return MockedResponse(
15 HTTPStatus.OK,
16 """
17 {
18 "sub": "00u33ow83pjQpCQJr1j8",
19 "name": "Jon Smith",
20 "locale": "AE",
21 "email": "[email protected]",
22 "nickname": "Jon Smith",
23 "preferred_username": "[email protected]",
24 "given_name": "Jon",
25 "family_name": "Smith",
26 "zoneinfo": "America/Los_Angeles",
27 "updated_at": 1601285210,
28 "email_verified": true
29 }
30 """,
31 )
32
33 def get_expected_to_str(self):
34 return "[email protected]"