| 1 |
from http import HTTPStatus |
| 2 |
|
| 3 |
from django.test import TestCase |
| 4 |
|
| 5 |
from allauth.socialaccount.providers.miro.provider import MiroProvider |
| 6 |
from tests.apps.socialaccount.base import OAuth2TestsMixin |
| 7 |
from tests.mocking import MockedResponse |
| 8 |
|
| 9 |
|
| 10 |
class MiroTests(OAuth2TestsMixin, TestCase): |
| 11 |
provider_id = MiroProvider.id |
| 12 |
|
| 13 |
def get_mocked_response(self): |
| 14 |
return MockedResponse( |
| 15 |
HTTPStatus.OK, |
| 16 |
"""{ |
| 17 |
"type" : "user", |
| 18 |
"id" : "5298357290348572584", |
| 19 |
"name" : "Pavel Oborin", |
| 20 |
"createdAt" : "2017-03-23T09:41:01Z", |
| 21 |
"role" : "developer", |
| 22 |
"email" : "[email protected]", |
| 23 |
"state" : "registered", |
| 24 |
"picture" : { |
| 25 |
"type" : "picture", |
| 26 |
"id" : "Optional[5289752983457238457]", |
| 27 |
"imageUrl" : "https://r.miro.com/some/image" |
| 28 |
} |
| 29 |
}""", |
| 30 |
) |
| 31 |
|
| 32 |
def get_expected_to_str(self): |
| 33 |
return "[email protected]" |