Login service support for JWT Cookies
This commit is contained in:
@@ -546,9 +546,10 @@ def get_enterprise_learner_data(user):
|
||||
"""
|
||||
Client API operation adapter/wrapper
|
||||
"""
|
||||
enterprise_learner_data = EnterpriseApiClient(user=user).fetch_enterprise_learner_data(user)
|
||||
if enterprise_learner_data:
|
||||
return enterprise_learner_data['results']
|
||||
if user.is_authenticated:
|
||||
enterprise_learner_data = EnterpriseApiClient(user=user).fetch_enterprise_learner_data(user)
|
||||
if enterprise_learner_data:
|
||||
return enterprise_learner_data['results']
|
||||
|
||||
|
||||
@enterprise_is_enabled(otherwise={})
|
||||
|
||||
@@ -166,10 +166,7 @@ class TestEnterpriseApi(EnterpriseServiceMockMixin, CacheIsolationTestCase):
|
||||
|
||||
@httpretty.activate
|
||||
def test_consent_needed_for_course(self):
|
||||
user = mock.MagicMock(
|
||||
username='janedoe',
|
||||
is_authenticated=lambda: True,
|
||||
)
|
||||
user = UserFactory(username='janedoe')
|
||||
request = mock.MagicMock(session={}, user=user)
|
||||
self.mock_enterprise_learner_api()
|
||||
self.mock_consent_missing(user.username, 'fake-course', 'cf246b88-d5f6-4908-a522-fc307e0b0c59')
|
||||
|
||||
Reference in New Issue
Block a user