'Performs full procedure of a successful OpenID provider login for user,
all required data is taken form ``user`` attribute which is an instance
of ``User`` model. As a convenience this method will also set
``profile.name`` for the user.'

def _attempt_login_and_perform_final_response(self, user, profile_name):

    url = reverse('openid-provider-login')
    user.profile.name = profile_name
    user.profile.save()
    self.client.login(username=user.username, password='test')
    self.attempt_login(200)
    post_args = {'email': user.email, 'password': 'test'}
    return self.client.post(url, post_args)
