Bug 1059828: Begin adding tests for allauth workflows.

This consolidates and/or obsoletes some of our pre-existing tests with
new, more granular tests of the Persona workflow.

Tests added/consolidated here verify that:

* Persona authentication failure is handled gracefully.

* Persona authentication failure produces the correct error message.

* Persona authentication during signup properly leads into profile
  creation.

* Persona-based profile creation shows the correct Persona-relevant
  messages.

* Persona sign-in with an existing account redirects correctly (to
  home page or to page the user signed in from).

* After signing in with Persona, auth-related UI elements show Persona
  identification.

* Pages displayed to non-authenticated users come pre-loaded with the
  stub Persona form and relevant data attributes.

* After signing up with Persona, a new Django User object and a new
  SocialAccount object are created, and populated with the correct data.

* After signing up with Persona, auth-related UI elements show Persona
  identification.

On 25 Sep 2014, at 00:20, luke crouch <notifications@github.com> wrote:

> In kuma/users/tests/test_views.py:
> 
> > +
> > +    def test_persona_signin_next(self):
> > +        """
> > +        When an existing user successfully authenticates with Persona,
> > +        from a page which supplied a 'next' parameter, they are
> > +        redirected back to that page following authentication.
> > +        
> > +        """
> > +        with mock.patch('requests.post') as requests_mock:
> > +            requests_mock.return_value.json.return_value = {
> > +                'status': 'okay',
> > +                'email': self.existing_persona_email,
> > +            }
> > +            doc_url = reverse('wiki.document', args=['article-title'],
> > +                              locale=settings.WIKI_DEFAULT_LANGUAGE)
> > +            login_url = urlparams(reverse('persona_login'),
> 
> Not sure what this comment is about? login_url, or did you mean the whole test_persona_signin_next? Both are needed as far as I can tell.

The login_url variable was not used, that’s all.=