in src/loadgenerator/locustfile.py [0:0]
def login(self):
"""
sends POST request to /login with stored credentials
succeeds if a token was returned
"""
with self.client.post("/login", {"username":self.user.username,
"password":MASTER_PASSWORD},
catch_response=True) as response:
for r_hist in response.history:
if r_hist.cookies.get('token') is not None:
response.success()
return
response.failure("login failed")