()
return jsonify({'msg': '测试成功', 'status': 1, 'data': {'report_id': new_report_id}})
单次运行任务
单次运行任务
单次运行任务
def run_task():
    """ 单次运行任务 """
    data = request.json
    ids = data.get('id')
    _data = Task.query.filter_by(id=ids).first()
    cases_id = get_case_id(_data.project_id, json.loads(_data.set_id), json.loads(_data.case_id))
    new_report_id = aps_test(_data.project_id, cases_id, _data.task_send_email_address, _data.email_password,
                             _data.task_to_email_address, User.query.filter_by(id=current_user.id).first().name,
                             _data.send_email_status)

    return jsonify({'msg': '测试成功', 'status': 1, 'data': {'report_id': new_report_id}})
def run_task ( ) : data = request . json ids = data . get ( 'id' ) _data = Task . query . filter_by ( id = ids ) . first ( ) cases_id = get_case_id ( _data . project_id , json . loads ( _data . set_id ) , json . loads ( _data . case_id ) ) new_report_id = aps_test ( _data . project_id , cases_id , _data . task_send_email_address , _data . email_password , _data . task_to_email_address , User . query . filter_by ( id = current_user . id ) . first ( ) . name , _data . send_email_status ) return jsonify ( { 'msg' : '测试成功', 'statu s : 1, 'da t ' : {'repo r _ id': new_re p rt_id}})