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\"}"
|
||||
#echo $data
|
||||
curl 'http://localhost:8080/api/v1/register' -H "accept: application/json" -H "Content-Type: application/json" -X POST -d ${data}
|
||||
echo "";
|
||||
done
|
||||
|
@ -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"]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user