fixed locust config

This commit is contained in:
konrad 2019-01-17 14:41:56 +01:00
parent 013f80fea7
commit b3b4d75130
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 3 additions and 1 deletions

View File

@ -5,4 +5,5 @@ do
data="{\"username\":\"testuser${f}\",\"email\":\"testuser${f}@kolaente.de\",\"password\":\"1234\"}"
#echo $data
curl 'http://localhost:8080/api/v1/register' -H "accept: application/json" -H "Content-Type: application/json" -X POST -d ${data}
echo "";
done

View File

@ -14,13 +14,14 @@ class VikunjaTaskSet(TaskSequence):
'content-type': "application/json",
'Authorization': ""
}
# Append your login or authentication keys to header
self.get_authentication_keys()
self.listIDs = []
self.namespaces = {}
def get_authentication_keys(self):
response = self.client.post("/login", {"username":"testuser" + str(random.randint(1, 100)), "password":"1234"})
response = self.client.post("/login", '{"username":"testuser' + str(random.randint(1, 100)) + '", "password":"1234"}', headers=self.headers)
data = json.loads(response.text)
self.headers["Authorization"] = 'Bearer ' + data["token"]