mirror of
https://github.com/pds-nest/nest.git
synced 2025-03-14 12:33:37 +00:00
Warning: breaking changes ahead! All the data that gets returned by functions is now incapsulated within "data" (response['data']).
20 lines
568 B
Python
20 lines
568 B
Python
import requests
|
|
import json
|
|
|
|
auth_code = ""
|
|
|
|
|
|
def test_login():
|
|
global auth_code
|
|
r = requests.post('http://localhost:5000/api/login', json={'email': 'admin@admin.com', 'password': 'amogus'})
|
|
j = json.loads(r.text)
|
|
assert j['result'] == "failure"
|
|
r = requests.post('http://localhost:5000/api/login', json={'email': 'admin@admin.com', 'password': 'password'})
|
|
j = json.loads(r.text)
|
|
assert j['result'] == "success"
|
|
auth_code = j['data']['access_token']
|
|
print("Login eseguito correttamente!")
|
|
|
|
|
|
print("Testing del login")
|
|
test_login()
|