'Successful auth to existing account is reflected in tools.'

def test_signin(self):

    user = User.objects.get(username=self.existing_username)
    user.socialaccount_set.create(provider='github', uid=self.github_token_data['uid'])
    profile_data = self.github_profile_data.copy()
    profile_data['login'] = self.existing_username
    profile_data['email'] = self.existing_email
    response = self.github_login(profile_data=profile_data)
    assert (response.status_code == 200)
    locale = settings.WIKI_DEFAULT_LANGUAGE
    user_url = reverse('users.user_detail', kwargs={'username': self.existing_username}, locale=locale)
    logout_url = reverse('account_logout', locale=locale)
    home_url = reverse('home', locale=locale)
    signout_url = urlparams(logout_url)
    parsed = pq(response.content)
    login_info = parsed.find('.login')
    user_link = login_info.children('.user-url')
    assert (user_link.attr['href'] == user_url)
    form = login_info.find('form')
    expected = signout_url.replace('%2F', '/')
    assert (form.attr['action'] == expected)
    assert (form.attr['method'] == 'post')
    next_input = form.children("input[name='next']")
    assert (next_input.val() == home_url)
    csrf_input = form.children("input[name='csrfmiddlewaretoken']")
    assert (csrf_input.val() is not None)
