1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-23 05:24:18 +00:00
pds-2021-g2-nest/code/backend/nest_backend/test/user_delete_test.py

26 lines
662 B
Python
Raw Normal View History

2021-04-27 22:44:21 +00:00
import requests
import json
auth_code = ""
def test_user_delete():
global auth_code
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']
r = requests.post(f'http://localhost:5000/api/user/remove', headers={'authorization': "Bearer " + auth_code},
json={'email': 'utente10@nest.com'})
j = json.loads(r.text)
assert j['result'] == "success"
print("User_delete eseguito correttamente!")
2021-04-27 22:47:23 +00:00
2021-04-27 22:44:21 +00:00
print("Testing del metodo user_delete")
test_user_delete()