1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-21 20:44:18 +00:00

eliminate print di controllo

This commit is contained in:
stefanogoldoni 2021-04-29 22:46:30 +02:00
parent 925ff9a9fa
commit deefe6841a

View file

@ -8,13 +8,13 @@ auth_code = ""
class MyTestCase(unittest.TestCase):
def test_login(self):
global auth_code
r = requests.post('http://localhost:5000/api/login', json={'email': 'admin@admin.com', 'password': 'amogus'})
r = requests.post('http://localhost:5000/api/v1/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': '', 'password': ''})
r = requests.post('http://localhost:5000/api/v1/login', json={'email': '', 'password': ''})
j = json.loads(r.text)
assert j['result'] == "failure"
r = requests.post('http://localhost:5000/api/login', json={'email': 'admin@admin.com', 'password': 'password'})
r = requests.post('http://localhost:5000/api/v1/login', json={'email': 'admin@admin.com', 'password': 'password'})
j = json.loads(r.text)
assert j['result'] == "success"
auth_code = j['data']['access_token']