'When we suspect the signup form is used as a connection form, abort.
https://bugzil.la/1063830'

def test_pre_social_login_error_for_unmatched_login(self):

    github_account = SocialAccount.objects.get(user__username='testuser2')
    github_login = SocialLogin(account=github_account, user=github_account.user)
    request = self.rf.get('/')
    session = self.client.session
    session['socialaccount_sociallogin'] = github_login.serialize()
    session.save()
    request.session = session
    messages = self.get_messages(request)
    other_account = SocialAccount(user=self.user_model(), provider='other', uid='noone@inexistant.com')
    other_login = SocialLogin(account=other_account)
    self.assertRaises(ImmediateHttpResponse, self.adapter.pre_social_login, request, other_login)
    queued_messages = list(messages)
    eq_(len(queued_messages), 1)
    eq_(django_messages.ERROR, queued_messages[0].level)
