from django.test.utils import override_settings from allauth.socialaccount.tests import OAuth2TestsMixin from allauth.tests import MockedResponse, TestCase from .provider import NextCloudProvider @override_settings( SOCIALACCOUNT_PROVIDERS={"nextcloud": {"SERVER": "https://nextcloud.example.org"}} ) class NextCloudTests(OAuth2TestsMixin, TestCase): provider_id = NextCloudProvider.id def get_login_response_json(self, with_refresh_token=True): return ( super(NextCloudTests, self) .get_login_response_json(with_refresh_token=with_refresh_token) .replace("uid", "user_id") ) def get_mocked_response(self): return MockedResponse( 200, """ ok 100 OK 1 batman /var/www/html/data/batman 1553946472000 Database 1455417655296 467191265 1455884846561 0.03 -3 batman@wayne.com batman 7351857301
BatCave, Gotham City
https://batman.org @the_batman admin fr fr_FR 1 1
""", )