Add new test; refactor others.
Add new test; refactor others.

Generalized the `generate_token` call and some of the message reading
we do to cut out some copy+pasting after running into a few problems.
Also added a new test verifying that a logged-in user different from
an invited user results in the right behaviour.

alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend,alphagov/digitalmarketplace-supplier-frontend