Esempio n. 1
0
 def test_023_api_78dk_sht__store_modifystorebasic_email_error(self):
     """
     新增门店基本信息:信息正确
     :return:
     """
     res = json.loads(
         ShtAction.test_api_78dk_sht__store_modifyStoreBasic(
             storeprovincecode='130000',
             leasetimebegin='2019-08-08',
             storename=store_name,
             leasetimeend='2020-08-08',
             employeesnum=100,
             storeregion='新华区',
             managername=name,
             managerphone=mobile,
             storeuuid='',
             storecitycode='130100',
             storeregioncode='130105',
             area='1999',
             storeaddress='hxhhxhchchhchchcjcjj',
             storeprovince='河北省',
             idcardnumber=cardnumber,
             email=MockData.strNumber(10),
             storecity='石家庄市'))
     Assertion.verity(res['msg'], '门店名重复!')
     Assertion.verity(res['code'], 'S0006')
Esempio n. 2
0
 def test_007_api_78dk_platform_om_bd_addBdInfo_256mobile(self):
     """
     BD新增 256 mobile
     :return:
     """
     res = PlatformAction.test_api_78dk_platform_om_bd_addBdInfo(channeluuid=channelid, email=email,
         mobile=MockData.strNumber(256), name=bd_name)
     Assertion.verity(json.loads(res)['code'], '20000')
     Assertion.verity(json.loads(res)['msg'], '手机格式不合法,')
Esempio n. 3
0
 def test_014_api_78dk_sht_mm_base_legal_modifylegalperson_17cardnumber(self):
     """
     保存商户法人信息--异常场景-法人身份证号错误
     :return:
     """
     res = json.loads(ShtAction.test_api_78dk_sht_mm_base_legal_modifyLegalPerson(shfrsfzfsc='', name='法人名字',
         uuid=sht_merchantUuid, shfrsfzf='', mobile=mobile, cardnumber=MockData.strNumber(17), shfrsfzz=''))
     Assertion.verity(res['code'], 'S0006')
     Assertion.verity(res['msg'], '法人身份证格式错误')
Esempio n. 4
0
 def test_008_api_78dk_platform_om_bd_addBdInfo_256name(self):
     """
     BD新增  256 name
     :return:
     """
     res = WebAction.test_api_78dk_platform_om_bd_addBdInfo(
         email=email, mobile=mobile, name=MockData.strNumber(256))
     Assertion.verity(json.loads(res)['code'], '20000')
     Assertion.verityContain(json.loads(res)['msg'], 'BD新增数据出错!')
Esempio n. 5
0
 def test_043_api_78dk_sht_mm_modifymerchantinfo_19socialunifiedcreditcode(self):
     """
     保存商户基础信息---统一社会信用代码为超长
     :return:
     """
     res = json.loads(ShtAction.test_api_78dk_sht_mm_modifyMerchantInfo(tradefirst='1', shzzjgdm='', name=name,
         uuid=sht_merchantUuid, organizationcode='123', taxregistrationnumber='123',
         socialunifiedcreditcode=MockData.strNumber(19), shswdjz='', shyyzz='', installmentcooperationorgs=[],
         city='110100', province='110000', papermergen=False, tradesecond='7'))
     Assertion.verity(res['msg'], '社会统一征信代码过长')
     Assertion.verity(res['code'], 'S0006')
Esempio n. 6
0
def modif(data, modif_key, modif_value):
    """
    修改京东请求数据
    :param data:
    :param modif_key:
    :param modif_value:
    :return:
    address: 收件人地址
    status:订单状态
    dealtime:下单时间
    name:收件人姓名
    telephone:收件人电话
    amount:订单总价
    goodsPrice:商品单价
    goodsNum:商品数量
    goodsName:商品名称
    amount_total: 总价格
    orderNum:订单数量,查询第一条订单后循环生成相同订单,配合其他条件使用
    """
    if modif_key == "address":
        data["order"][0]["address"] = modif_value
    elif modif_key == "status":
        data["order"][0]["status"] = modif_value
    elif modif_key == "dealtime":
        start, end = get_data(modif_value)
        data["order"][0]["dealtime"] = TimeFormat.random_time(start, end)
    elif modif_key == "first_deal_time":
        if modif_value == '7':
            data["first_deal_time"] = TimeFormat.get_day_end_time(-7)
        else:
            # num = int(modif_value) * 30
            data["first_deal_time"] = TimeFormat.get_month_ago(
                int(modif_value))
    elif modif_key == "name":
        data["order"][0]["name"] = modif_value
    elif modif_key == "telephone":
        data["order"][0]["telephone"] = modif_value
    elif modif_key == "amount":
        data["order"][0]["amount"] = modif_value
    elif modif_key == "goodsPrice":
        data["order"][0]["goods"][0]["goodsPrice"] = FileUtils.str_to_num(
            modif_value)
    elif modif_key == "goodsNum":
        data["order"][0]["goods"][0]["goodsNum"] = FileUtils.str_to_num(
            modif_value)
    elif modif_key == "goodsName":
        data["order"][0]["goods"][0]["goodsName"] = modif_value
    elif modif_key == "amount_total":
        data["order"][0]["amount_total"] = "商品总金额:¥{}".format(
            FileUtils.str_to_num(modif_value))
    elif modif_key == 'orderNum':
        order_info = data["order"][0]
        dealtime = order_info['dealtime'].split(' ')[0]
        orders_info = list()
        for _ in range(int(modif_value)):
            o = copy.deepcopy(order_info)
            o['orderid'] = MockData.strNumber(11)
            o['dealtime'] = TimeFormat.random_time(dealtime + ' 00:00:01',
                                                   dealtime + ' 23:59:59')
            orders_info.append(o)
        data["order"] = orders_info