2021-05-07 22:38:17 +00:00
|
|
|
from flask.testing import Client
|
|
|
|
|
|
|
|
|
2021-05-08 14:36:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-07 22:38:17 +00:00
|
|
|
class TestUserGet:
|
2021-05-08 14:36:50 +00:00
|
|
|
def test_for_success(self, flask_client: Client, headers):
|
|
|
|
r = flask_client.get(f'/api/v1/users/admin@admin.com', headers=headers)
|
2021-05-07 22:38:17 +00:00
|
|
|
assert b'success' in r.data
|
|
|
|
|
|
|
|
|
|
|
|
class TestUserAdd:
|
2021-05-08 14:36:50 +00:00
|
|
|
def test_for_success(self, flask_client: Client, headers):
|
|
|
|
r = flask_client.post(f'/api/v1/users/', headers=headers,
|
2021-05-07 22:38:17 +00:00
|
|
|
json={'email': 'utente_test@nest.com', 'password': 'password', 'username': 'utente_test'})
|
|
|
|
assert b'success' in r.data
|
|
|
|
|
|
|
|
|
|
|
|
class TestUserDelete:
|
2021-05-08 14:36:50 +00:00
|
|
|
def test_for_success(self, flask_client: Client, headers):
|
|
|
|
r = flask_client.delete(f'/api/v1/users/utente_test@nest.com', headers=headers)
|
2021-05-07 22:38:17 +00:00
|
|
|
assert b'success' in r.data
|