dimanche 1 avril 2018

How to test a social_auth_app_django custom pipeline?

I have a custom pipeline which pulls the name of the user from the response. How do I test the pipeline with django.test.TestCase?

Here's the code for the pipeline:

def save_profile(backend, user, response, *args, **kwargs):
        if backend.name == 'github':
    try:
        userprofile = UserProfile.objects.get(user=user)
    except UserProfile.DoesNotExist:
        UserProfile.objects.create(user=user, name=response.get('name'))

Aucun commentaire:

Enregistrer un commentaire