We sometimes update preexisting SAML SSO providers to configure them to automatically create SSO identity verification (IdV) records when a learner links an account via that provider. Turning that configuration from off to on does make it such that when learners log back in via their linked account, a new IdV record will be created for them. But it's possible we'd want this process to happen more automatically and seamlessly, for which this management command will be helpful. Note that this does not help with removing SSO verification records for a provider for which this configuration has been turned off. JIRA:EDUCATOR-4947
22 lines
572 B
Python
22 lines
572 B
Python
"""
|
|
Sharable utilities for testing program enrollments
|
|
"""
|
|
|
|
from factory import LazyAttributeSequence, SubFactory
|
|
from factory.django import DjangoModelFactory
|
|
from social_django.models import UserSocialAuth
|
|
from student.tests.factories import UserFactory
|
|
|
|
|
|
class UserSocialAuthFactory(DjangoModelFactory):
|
|
"""
|
|
Factory for UserSocialAuth records.
|
|
"""
|
|
class Meta(object):
|
|
model = UserSocialAuth
|
|
user = SubFactory(UserFactory)
|
|
uid = LazyAttributeSequence(lambda o, n: '%s:%d' % (o.slug, n))
|
|
|
|
class Params(object):
|
|
slug = 'gatech'
|