Debian Codegraph @

tests/apps/socialaccount/providers/eventbrite/tests.py

raw
1 """Test Eventbrite OAuth2 v3 Flow."""
2
3 from http import HTTPStatus
4
5 from django.test import TestCase
6
7 from allauth.socialaccount.providers.eventbrite.provider import EventbriteProvider
8 from tests.apps.socialaccount.base import OAuth2TestsMixin
9 from tests.mocking import MockedResponse
10
11
12 class EventbriteTests(OAuth2TestsMixin, TestCase):
13 """Test Class for Eventbrite OAuth2 v3."""
14
15 provider_id = EventbriteProvider.id
16
17 def get_mocked_response(self):
18 """Test authentication with an non-null image_id"""
19 return MockedResponse(
20 HTTPStatus.OK,
21 """{
22 "emails": [{
23 "email": "[email protected]",
24 "verified": true
25 }],
26 "id": "999999999",
27 "name": "Andrew Godwin",
28 "first_name": "Andrew",
29 "last_name": "Godwin",
30 "image_id": "99999999"
31 }""",
32 )
33
34 def get_expected_to_str(self):
35 return "[email protected]"