use the email address from the create test user response #2791
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Traditionally test users have used the first name field to determine whether someone is a test user or not.
However this is less reliable than using email address as the email address field is passed around everywhere whereas there has to be special logic to get test users' first name around to the right places (as for a "real" user, first name would be extra PII)
In some other PRs, changes are proposed to embed the generated token into email addresses. This means that the email address is generated on the fly, so anything using the create test user endpoint, needs to look in the response to find out what the generated email address is.
--
This PR updates gateway to get the email address out of the response, rather than relying on what was passed in to be correct. See https://github.com/guardian/identity/pull/2528 for the PR that makes the changes that this PR depends on.