def test(data): new_password = '******' response = users.reset_password(data.username, new_password) assert response.status_code == 200 assert response.json() == {'errors': []} response = auth.get_token_request(data.username, new_password) assert response.status_code == 200
def test_reset_user_password(data): username = actions.random_str() users.create_new_user(username, '123456', '*****@*****.**') new_password = '******' response = users.reset_password(username, new_password) assert response.status_code == 200 assert response.json() == {'errors': []} response = auth.get_token_request(username, new_password) assert response.status_code == 200
def test(data): response = auth.get_token_request(data.env.users.admin.username, 'incorrect_password') assert response.status_code == 401
def test(data): response = auth.get_token_request(data.env.users.admin.username, data.env.users.admin.password) assert response.status_code == 200 assert type(response.json()) is str
def test_get_token_with_unknown_user(data): response = auth.get_token_request('unknown_user_01', 'does not matter') assert response.status_code == 401