def test_maintain_no_time(): # 新增养护记录(养护时间不输入) maintain_data = copy.deepcopy(MAINTAIN_DATA) maintain_data.pop('main_time') maintain_new(maintain_data, exp_http_status=500, exp_status='0001', exp_message=u'养护日期不能为空')
def test_maintain_no_sale(): # 新增养护记录(是否继续销售标志不输入) maintain_data = copy.deepcopy(MAINTAIN_DATA) maintain_data.pop('is_sale') maintain_new(maintain_data, exp_http_status=500, exp_status='0001', exp_message=u'是否继续销售标志不能为空')
def test_maintain_no_quality(): # 新增养护记录(外包装质量情况不传) maintain_data = copy.deepcopy(MAINTAIN_DATA) maintain_data.pop('goods_quality') maintain_new(maintain_data, exp_http_status=500, exp_status='0001', exp_message=u'外包装质量情况不能为空')
def test_maintain_delete(): """养护记录删除""" maintain_data = copy.deepcopy(MAINTAIN_DATA) resp_new = maintain_new(maintain_data) main_id = resp_new['data']['main_id'] maintain_delete(main_id) verify_result(maintain_data['goods_id'], main_id)
def test_maintain_sale_0(): # 新增养护记录(不继续销售) maintain_data = copy.deepcopy(MAINTAIN_DATA) maintain_data['is_sale'] = 0 resp = maintain_new(maintain_data) # 校验 verify_result(maintain_data, resp['data']['main_id'])
def test_maintain_update(): """养护记录修改""" # 新增养护记录 maintain_data = copy.deepcopy(MAINTAIN_DATA) resp_new = maintain_new(maintain_data) maintain_data_update = copy.deepcopy(MAINTAIN_DATA_UPDATE) maintain_update(resp_new['data']['main_id'], maintain_data_update) # 校验 verify_result(maintain_data_update, maintain_data['goods_id'], resp_new['data']['main_id'])
def test_maintain_list(): """养护记录列表""" # 新增养护记录 maintain_data = copy.deepcopy(MAINTAIN_DATA) resp_new = maintain_new(maintain_data) # 养护记录列表 params = copy.deepcopy(PARAMS_MAINTAIN_LIST) params['goods_id'] = maintain_data['goods_id'] resp = get_maintain_list(params) # 校验 verify_result(maintain_data, resp['data'][-1], resp_new['data']['main_id'])
def test_maintain(): # 新增养护记录 maintain_data = copy.deepcopy(MAINTAIN_DATA) resp = maintain_new(maintain_data) # 校验 verify_result(maintain_data, resp['data']['main_id'])