1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 21:14:18 +00:00
pds-2021-g2-nest/code/backend/nest_backend/test/test_user.py
Annielated d48d1e0f3f fix
2021-05-08 17:02:53 +02:00

20 lines
787 B
Python

from flask.testing import Client
class TestUserGet:
def test_for_success(self, flask_client: Client, admin_headers):
r = flask_client.get(f'/api/v1/users/admin@admin.com', headers=admin_headers)
assert b'success' in r.data
class TestUserAdd:
def test_for_success(self, flask_client: Client, admin_headers):
r = flask_client.post(f'/api/v1/users/', headers=admin_headers,
json={'email': 'utente_test@nest.com', 'password': 'password', 'username': 'utente_test'})
assert b'success' in r.data
class TestUserDelete:
def test_for_success(self, flask_client: Client, admin_headers):
r = flask_client.delete(f'/api/v1/users/utente_test@nest.com', headers=admin_headers)
assert b'success' in r.data