'Test that with auto signup the decorator
will bypass registration and call retfun.'

@skip_unless_lms
@override_settings(FEATURES=FEATURES_WITH_SSL_AUTH_IMMEDIATE_SIGNUP)
def test_ssl_decorator_auto_signup(self):

    dec_mock = external_auth_views.ssl_login_shortcut(self.mock)
    with self._create_ssl_request(self.MOCK_URL) as request:
        dec_mock(request)
    try:
        ExternalAuthMap.objects.get(external_id=self.USER_EMAIL)
    except ExternalAuthMap.DoesNotExist as ex:
        self.fail('User    did    not    get    properly    added    to    external    auth    map,    exception    was    {0}'.format(str(ex)))
    try:
        User.objects.get(email=self.USER_EMAIL)
    except ExternalAuthMap.DoesNotExist as ex:
        self.fail('User    did    not    get    properly    added    to    internal    users,    exception    was    {0}'.format(str(ex)))
    self.assertEqual(1, len(ExternalAuthMap.objects.all()))
    self.assertTrue(self.mock.called)
