Пример #1
0
def verify_result(resp):
    ages = ('has_bad', 'is_return', 'pati_id', 'pati_name', 'pay_time', 'proc_flag', 'proc_id', 'proc_no',
            'proc_state', 'sale_no')
    check_fields(ages, resp.keys())
    ages = ('batch_no', 'depot_id', 'depot_name', 'goods_state', 'item_batchid', 'item_goods_id', 'item_id',
            'item_goods_name', 'item_size', 'odos', 'proc_state', 'stoc_waste')
    check_fields(ages, resp['list'][0].keys())
Пример #2
0
def verify_result(resp_data):
    """
    :param resp_data: 查询结果
    :return:
    """
    args = ('far_list', 'near_list', 'contact_list', 'rgp_list')
    check_fields(args, resp_data.keys())
Пример #3
0
def verify_result(resp_data):
    """
    :param resp_data: 返回结果
    :return:
    """
    args = ('prop_prop_id', 'prop_prop_name', 'type', 'prop_prop_type',
            'prop_putinprop')
    check_fields(args, resp_data[0].keys())
Пример #4
0
def test_same_nation_list():
    # 批量入库时商品族列表
    params = copy.deepcopy(PARAMS_SAME_NATION_LIST)
    resp = get_same_nation_list(params)
    ages = ('bid_price', 'enable', 'nation_id', 'nation_name', 'unit')
    check_fields(ages, resp['data'][0].keys())
    assert resp['data'][0]['nation_name'] == u"欧普康士隐形眼镜"
    assert resp['data'][0]['bid_price'] == u"15.00"
Пример #5
0
def test_variety_list():
    """商品品种列表"""
    params = copy.deepcopy(PARAMS_VARIETY_LIST)
    resp = get_variety_list(params)
    args = ('page_num', 'page_size', 'total', 'pages', 'list')
    check_fields(args, resp['data'].keys())
    args = ('vari_id', 'vari_code', 'vari_name')
    check_fields(args, resp['data']['list'][0].keys())
Пример #6
0
def test_good_list():
    """加货选择商品"""
    resp = get_goods_list('177379170773500011', '177379174221218005', 1, 10)
    arg = ('page_num', 'page_size', 'total', 'pages', 'list')
    check_fields(resp['data'], arg)
    arg_list = ('goods_id', 'goods_name', 'goods_batchno', 'validity',
                'stock_num')
    check_fields(resp['data']['list'][0], arg_list)
Пример #7
0
def test_get_atm_channel_list():
    """货道列表"""
    resp = get_atm_channel_list("177379170773500011", 1, 3)
    arg = ('page_num', 'page_size', 'total', 'pages', 'list')
    check_fields(resp['data'], arg)
    arg_list = ('channel_id', 'channel_code', 'max_num', 'channel_num',
                'goods_name', 'goods_batchno', 'validity', 'operator_id',
                'oper_date', 'goods_id')
    check_fields(arg_list, resp['data']['list'][0])
Пример #8
0
def test_goods_changes():
    # 商品进销存详情列表
    params = copy.deepcopy(PARAMS_STOCK_INFO_GOODS_CHANGES)
    resp = get_stock_info_goods_changes(params)
    aegs = ('change_name', 'change_no', 'change_time')
    check_fields(aegs, resp['data']['list'][0].keys())
    ages = ('change_num', 'goods_bidprice', 'goods_price')
    check_fields(ages, resp['data']['list'][0]['batch_list'][0].keys())
    assert resp['data']['list'][0]['change_name']
Пример #9
0
def test_stock_goods_list():
    """库存详情商品列表"""
    resp = stock_goods_list('scph003')
    arg = ('page_num', 'page_size', 'total', 'pages', 'list')
    arg_list = ('depot_name', 'depot_id', 'goods_id', 'goods_name',
                'goods_factory_id', 'goods_factory', 'goods_stoc_name',
                'stoc_chan_num', 'goods_src_price')
    check_fields(resp['data'], arg)
    check_fields(resp['data']['list'][0], arg_list)
Пример #10
0
def test_maintain_goods_list():
    """养护记录商品列表"""
    params = copy.deepcopy(PARAMS_MAINTAIN_GOODS_LIST)
    resp = get_maintain_goods_list(params)
    ages = ('goods_batch', 'goods_factory', 'goods_id', 'goods_intime',
            'goods_main_count', 'goods_main_quality', 'goods_main_time',
            'goods_name', 'goods_registrno', 'goods_stoc_num',
            'goods_supplier', 'goods_unit', 'goods_validity', 'is_sale')
    check_fields(ages, resp['data']['list'][0].keys())
Пример #11
0
def test_batch_update_goods_list():
    # 批量修改时查询商品列表
    params = copy.deepcopy(PARAMS_BATCH_UPDATE_GOODS_LIST)
    resp = get_batch_update_goods_list(params)
    ages = ('good_bidprice', 'good_code', 'good_id', 'good_name', 'good_price',
            'good_sell', 'good_unit')
    check_fields(ages, resp['data']['list'][0].keys())
    assert resp['data']['page_num']
    assert resp['data']['page_size']
    assert resp['data']['pages']
Пример #12
0
def verify_result(resp_data):
    ages = ('batchProducedDateLong', 'batch_batchno', 'batch_id', 'can_fetch',
            'is_pickup', 'item_goods_id', 'item_goods_name', 'item_odos',
            'item_size', 'pati_birthday', 'saleUserId', 'sale_no',
            'statDepoId', 'stat_id', 'stat_purchase', 'stoc_id', 'tradTime',
            'trad_payuser')
    check_fields(ages, resp_data[0].keys())
    # ages = ('choi_value', 'prop_prop_id', 'prop_prop_name', 'prop_putinprop')
    # check_fields(ages, resp_data[0].keys())
    assert resp_data[0]['item_goods_name'] == u"欧普康士隐形眼镜+1.44001"
Пример #13
0
def verify_result(resp):
    """
    :param resp: 返回结果
    :return:
    """
    resp_data = resp['data']
    args = ('page_num', 'page_size', 'total', 'pages', 'list')
    check_fields(args, resp_data.keys())
    args_goods = ('good_id', 'good_name', 'good_price', 'clas_process',
                  'good_give', 'depot_id', 'depot_name', 'has_char')
    check_fields(args_goods, resp_data['list'][0].keys())
Пример #14
0
def test_same_nation_view():
    # 批量入库时某族商品详细
    resp = get_nation_view(constants.NATION_ID)
    ages = ('good_id', 'good_bidprice', 'good_code', 'good_factory', 'good_factory_name', 'good_id',
            'good_name', 'good_now_price', 'good_supplier', 'good_supplier_name', 'good_unit')
    check_fields(ages, resp['data'][0]['goods'].keys())
    # ages = ('cylinder_value',)
    # check_fields(ages, resp['data'][0]['cylinder_list'][1].keys())
    # ages = ('sphere_value', )
    # check_fields(ages, resp['data'][0].keys())
    assert resp['data'][0]['goods']['good_id'] == u"132398028324733205"
    assert resp['data'][0]['goods']['good_code'] == u"opksYXTK+1.442.001.00"
Пример #15
0
def verify_result(resp_data):
    """
    :param resp_data: 查询结果
    :return:
    """
    args = ('page_num', 'page_size', 'total', 'pages', 'list')
    check_fields(args, resp_data.keys())
    res = resp_data['list'][0]
    args_good = ('good_id', 'good_name', 'good_code', 'good_bidprice', 'good_price', 'now_price', 'good_unit',
                 'good_supplier', 'good_supplier_name', 'good_factory', 'good_factory_name',
                 'good_class')
    check_fields(args_good, res.keys())
Пример #16
0
def verify_result(resp_data, exists=True):
    """
    :param resp_data: 返回结果
    :param exists: 返回列表是否有值
    :return:
    """
    if exists:
        ages = ('good_bidprice', 'good_code', 'good_id', 'good_name',
                'good_price', 'good_price', 'status')
        check_fields(ages, resp_data['list'][0].keys())
    else:
        assert len(resp_data['list']) == 0
Пример #17
0
def test_list():
    # 定做商品销售提货列表
    resp = REQUESTER.get(
        '/depo_service/pick/list?stat_depo_id={}&start_date=2018-03-10&end_date=2018-09-06&page_size=4&page_num=1'
        '&stat_purchase=1&stat_pickup=0'.format(constants.WDEPOT_ID))
    ages = ('can_fetch', 'is_bind', 'item_goods_id', 'item_goods_name',
            'item_odos', 'item_size', 'pati_age', 'pati_birthday',
            'purc_prop_text', 'saleUserId', 'sale_no', 'sale_user_name',
            'stat_id', 'stat_purchase', 'tradTime', 'trad_payuser',
            'trad_time')
    check_fields(ages, resp['data']['list'][0].keys())
    ages = ('choi_value', 'prop_prop_id', 'prop_prop_name', 'prop_putinprop')
    check_fields(ages, resp['data']['list'][0]['purc_prop_list'][0].keys())
Пример #18
0
def test_goods_copy():
    # resp = copy_goods(132398028257624820)
    resp = copy_goods(constants_yot_test.GOODS_ID)
    ages = ('good_unitid', 'good_unitname', 'status', 'good_bidprice',
            'good_price', 'good_class_id', 'good_class_name', 'good_brand_id',
            'good_brand', 'good_variety_id', 'good_variety_code',
            'good_variety', 'good_factory_id', 'good_factory',
            'good_supplier_id', 'good_supplier', 'good_give')
    check_fields(ages, resp['data'].keys())
    ages = ('prop_prop_id', 'prop_prop_name', 'choi_id', 'choi_code',
            'choi_value')
    check_fields(ages, resp['data']['list'][0].keys())
    assert resp['data']['good_unitid'] == constants_yot_test.GOODS_UNIT_ID
    assert resp['data'][
        'good_class_name'] == constants_yot_test.GOODS_CLASS_NAME
    assert resp['data']['list'][0]['prop_prop_name'] == u"颜色"
def verify_result(data_, resp):
    ages = ('adju_goods', 'adju_time', 'adju_user_name', 'adjustment_name',
            'total', 'total_bill_price', 'total_num', 'total_price',
            'total_src_bidprice', 'total_src_price')
    check_fields(ages, resp['data'].keys())
    data_goods = data_['adju_goods'][0]
    resp_goods = resp['data']['item_list'][0]
    assert resp_goods['item_id']
    assert resp_goods['item_goods_id'] == data_goods['goods_id']
    assert resp_goods['item_goods_name']
    assert str(resp_goods['item_src_bidprice']) == str(
        data_goods['goods_src_bidprice'])
    assert resp_goods['item_src_price']  # 原售价
    assert resp_goods['item_num'] == data_goods['goods_num']
    assert str(resp_goods['item_bill_bidprice']) == str(
        data_goods['goods_bill_price'])
    assert str(resp_goods['item_price']) == str(data_goods['goods_price'])
    if data_goods.get('goods_supplyno', None):
        assert resp_goods['item_supplyno'] == data_goods['goods_supplyno']
    if data_goods.get('goods_rem', None):
        assert resp_goods['item_rem'] == data_goods['goods_rem']
    assert str(resp_goods['item_total']) == str(data_goods['goods_total'])
Пример #20
0
def test_allo():
    # 调拨单详情
    resp = REQUESTER.get(
        '/depo_service/allo?allo_id=142887028382630863&type=0')
    ages = ('alloMakeTime', 'alloMakeUser', 'allo_id', 'allo_in_depot',
            'allo_in_depot_name', 'allo_make_time', 'allo_make_user',
            'allo_no', 'allo_out_depot', 'allo_out_depot_name', 'allo_rem',
            'allo_state')
    check_fields(ages, resp['data'].keys())
    ages = ('amount_price', 'batchValidity', 'batch_batchno',
            'batch_goods_registrno', 'batch_id', 'batch_validity',
            'good_unitname', 'goods_class', 'goods_class_name', 'itemPrice',
            'item_amount', 'item_depo_num', 'item_goods_id', 'item_goods_name',
            'item_id', 'item_num', 'item_num_unitname', 'item_price',
            'mfr_name', 'produced_date', 'stoc_depo_id', 'stoc_id',
            'stoc_waste', 'unit_price', 'variName')
    check_fields(ages, resp['data']['list'][0].keys())
    ages = ('choi_value', 'prop_id', 'prop_prop_id', 'prop_prop_name',
            'prop_putinprop')
    check_fields(ages, resp['data']['list'][0]['list'][0].keys())
    assert resp['data']['allo_id'] == "142887028382630863"
    assert resp['data']['allo_make_user'] == u"施秋梅"
Пример #21
0
def verify_result(resp):
    ages = ('account_id', 'account_name', 'enable')
    check_fields(ages, resp[0].keys())
Пример #22
0
def test_good_prop_list():
    """通过属性名称查询属性"""
    prop_name = constants.PROP_NAME
    resp = get_good_prop_list_by_name(prop_name)
    args = ('prop_id', 'prop_name')
    check_fields(args, resp['data'][0].keys())
Пример #23
0
def verify_result(resp_data):
    args = ('proc_id', 'proc_no', 'sale_no', 'pay_time', 'proc_state', 'pati_id', 'pati_name')
    check_fields(args, resp_data.keys())
Пример #24
0
def verify_result(resp):
    args = ('page_num', 'page_size', 'total', 'pages', 'list')
    check_fields(args, resp.keys())
    args = ('choi_id', 'choi_value')
    check_fields(args, resp['list'][0].keys())
Пример #25
0
def verify_result(resp):
    args = ('refu_id', 'refu_make_user_name', 'refu_make_time', 'refu_sale_no',
            'sale_no', 'pay_time', 'sale_user_name', 'list')
    check_fields(args, resp.keys())
Пример #26
0
def verify_result(resp_data):
    args = ('clas_id', 'clas_code', 'clas_name', 'list')
    check_fields(args, resp_data[0].keys())
    args_good = ('goods_id', 'goods_name', 'goods_unit')
    check_fields(args_good, resp_data[0]['list'][0].keys())
Пример #27
0
def verify_result(resp):
    ages = ('choi_id', )
    check_fields(ages, resp.keys())
Пример #28
0
def verify_result(resp):
    ages = ('stat_id', 'stat_sale_itemid', 'stat_goods_id', 'goods_name', 'stat_depo_id', 'depo_name',
            'stat_pickup', 'is_return')
    check_fields(ages, resp[0].keys())
Пример #29
0
def verify_result(resp):
    args = ('vari_id', 'vari_name')
    check_fields(args, resp['list'][0].keys())
Пример #30
0
def test_goods_modes():
    # 进销存业务列表
    params = copy.deepcopy(PARAMS_STOCK_INFO_GOODS_MODES)
    resp = get_stock_info_goods_modes(params)
    ages = ('mode_id', 'mode_name')
    check_fields(ages, resp['data'][0].keys())