'After a new user signs up with Persona, their username, an
indication that Persona was used to log in, and a logout link
appear in the auth tools section of the page.'

def test_signup(self):

    response = self.github_login()
    assert (response.status_code == 200)
    assert ('Sign    In    Failure' not in response.content)
    username = self.github_profile_data['login']
    email = self.github_email_data[0]['email']
    data = {'website': '', 'username': username, 'email': email, 'terms': True}
    locale = settings.WIKI_DEFAULT_LANGUAGE
    signup_url = reverse('socialaccount_signup', locale=locale)
    response = self.client.post(signup_url, data=data, follow=True)
    assert (response.status_code == 200)
    user_url = reverse('users.user_detail', kwargs={'username': 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)
