Refactor "create_user" to actually create a user

This switches a number of fixtures to use "sample_user", which is
equivalent to calling the previous "create_user" function when it
used to default the email to "notify@...".
This commit is contained in:
Ben Thorner
2021-09-08 11:16:46 +01:00
parent 922fd2f333
commit c9ea85938a
3 changed files with 30 additions and 37 deletions

View File

@@ -81,7 +81,7 @@ from app.models import (
def create_user(
*,
mobile_number="+447700900986",
email="notify@digital.cabinet-office.gov.uk",
email=None,
state='active',
id_=None,
name="Test User"
@@ -89,7 +89,7 @@ def create_user(
data = {
'id': id_ or uuid.uuid4(),
'name': name,
'email_address': email,
'email_address': email or f"{uuid.uuid4()}@digital.cabinet-office.gov.uk",
'password': 'password',
'mobile_number': mobile_number,
'state': state