Upgraded to Python Social Auth 0.2.21 to resolve migration issue
This commit is contained in:
committed by
Clinton Blackburn
parent
5cd3a86382
commit
4cc7628696
@@ -44,11 +44,6 @@ class SAMLAuthBackend(SAMLAuth): # pylint: disable=abstract-method
|
||||
log.error('SAML authentication is not enabled')
|
||||
raise Http404
|
||||
|
||||
# TODO: remove this check once the fix is merged upstream:
|
||||
# https://github.com/omab/python-social-auth/pull/821
|
||||
if 'idp' not in self.strategy.request_data():
|
||||
raise AuthMissingParameter(self, 'idp')
|
||||
|
||||
return super(SAMLAuthBackend, self).auth_url()
|
||||
|
||||
def _check_entitlements(self, idp, attributes):
|
||||
|
||||
@@ -413,8 +413,10 @@ class IntegrationTest(testutil.TestCase, test.TestCase):
|
||||
def assert_redirect_to_dashboard_looks_correct(self, response):
|
||||
"""Asserts a response would redirect to /dashboard."""
|
||||
self.assertEqual(302, response.status_code)
|
||||
# NOTE: Ideally we should use assertRedirects(), however it errors out due to the hostname, testserver,
|
||||
# not being properly set. This may be an issue with the call made by PSA, but we are not certain.
|
||||
# pylint: disable=protected-access
|
||||
self.assertEqual(auth_settings._SOCIAL_AUTH_LOGIN_REDIRECT_URL, response.get('Location'))
|
||||
self.assertTrue(response.get('Location').endswith(django_settings.SOCIAL_AUTH_LOGIN_REDIRECT_URL))
|
||||
|
||||
def assert_redirect_to_login_looks_correct(self, response):
|
||||
"""Asserts a response would redirect to /login."""
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
import json
|
||||
|
||||
import httpretty
|
||||
|
||||
from provider.constants import PUBLIC
|
||||
from provider.oauth2.models import Client
|
||||
from social.apps.django_app.default.models import UserSocialAuth
|
||||
|
||||
from social.backends.facebook import FacebookOAuth2
|
||||
from student.tests.factories import UserFactory
|
||||
|
||||
from .testutil import ThirdPartyAuthTestMixin
|
||||
@@ -81,7 +80,7 @@ class ThirdPartyOAuthTestMixin(ThirdPartyAuthTestMixin):
|
||||
class ThirdPartyOAuthTestMixinFacebook(object):
|
||||
"""Tests oauth with the Facebook backend"""
|
||||
BACKEND = "facebook"
|
||||
USER_URL = "https://graph.facebook.com/v2.3/me"
|
||||
USER_URL = FacebookOAuth2.USER_DATA_URL
|
||||
# In facebook responses, the "id" field is used as the user's identifier
|
||||
UID_FIELD = "id"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user