fixed locust config
This commit is contained in:
parent
013f80fea7
commit
b3b4d75130
|
@ -5,4 +5,5 @@ do
|
||||||
data="{\"username\":\"testuser${f}\",\"email\":\"testuser${f}@kolaente.de\",\"password\":\"1234\"}"
|
data="{\"username\":\"testuser${f}\",\"email\":\"testuser${f}@kolaente.de\",\"password\":\"1234\"}"
|
||||||
#echo $data
|
#echo $data
|
||||||
curl 'http://localhost:8080/api/v1/register' -H "accept: application/json" -H "Content-Type: application/json" -X POST -d ${data}
|
curl 'http://localhost:8080/api/v1/register' -H "accept: application/json" -H "Content-Type: application/json" -X POST -d ${data}
|
||||||
|
echo "";
|
||||||
done
|
done
|
||||||
|
|
|
@ -14,13 +14,14 @@ class VikunjaTaskSet(TaskSequence):
|
||||||
'content-type': "application/json",
|
'content-type': "application/json",
|
||||||
'Authorization': ""
|
'Authorization': ""
|
||||||
}
|
}
|
||||||
|
|
||||||
# Append your login or authentication keys to header
|
# Append your login or authentication keys to header
|
||||||
self.get_authentication_keys()
|
self.get_authentication_keys()
|
||||||
self.listIDs = []
|
self.listIDs = []
|
||||||
self.namespaces = {}
|
self.namespaces = {}
|
||||||
|
|
||||||
def get_authentication_keys(self):
|
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)
|
data = json.loads(response.text)
|
||||||
self.headers["Authorization"] = 'Bearer ' + data["token"]
|
self.headers["Authorization"] = 'Bearer ' + data["token"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue