in src/loadgenerator/locustfile.py [0:0]
def signup_helper(locust, username):
"""
create a new user account in the system
succeeds if token was returned
"""
userdata = {"username":username,
"password":MASTER_PASSWORD,
"password-repeat":MASTER_PASSWORD,
"firstname": username,
"lastname":"TestAccount",
"birthday":"01/01/2000",
"timezone":"82",
"address":"1021 Valley St",
"city":"Seattle",
"state":"WA",
"zip":"98103",
"ssn":"111-22-3333"}
with locust.client.post("/signup", data=userdata, catch_response=True) as response:
for r_hist in response.history:
if r_hist.cookies.get('token') is not None:
response.success()
logging.debug("created user = %s", username)
return True
response.failure("login failed")
return False