def change_role(team_id): logger.info(f"Attempting to change roles in team #{team_id}.") req = ClientRequest(request) roles_changed = TeamService.change_role(req.change_role_data(team_id)) return jsonify(roles_changed.json()), roles_changed.status_code()
def test_change_role_data_with_full_data_works_properly(self): body_json = {"user_id": 0, "new_role": "MODERATOR"} input_request = Request(body=body_json, headers=authentication_headers) client_request = ClientRequest(input_request) self.assertIsInstance(client_request.change_role_data(mock), ChangeRoleDTO)