def addReceive(self):
    url='http://www.test.mbalib.com/goods/receive/saveReceive'
    access_token=Token.getToken()
    # 表单
    # 姓名
    name = '接口测试'
    # 电话
    mobile = '11111111111'
    # 省
    province = '350000'
    # 市
    city = '350200'
    # 区
    county = '350203'
    # 详细地址
    address = '软件园二期望海路59号之一'
    # 是否默认地址
    is_default = 0
    params = {'access_token': access_token, 'name': name, 'mobile': mobile, 'province': province, 'city': city,
              'county': county, 'address': address, 'is_default': is_default}
    response = requests.post(url, params)
    result = response.json()
    print(result)
    print("添加收货地址成功")
    self.assertNotEqual(len(result['data']), 0)
    receive_id = result['data']['receive_id']
    return receive_id
示例#2
0
def get_receiveList(self):
    url = 'http://www.test.mbalib.com/goods/receive/getReceiveList'
    access_token = Token.getToken()
    response = requests.post(url, params={'access_token': access_token})
    result = response.json()
    print(result)
    return result
def deleteReceive(self,id):
    url='http://www.test.mbalib.com/goods/receive/delReceive'
    access_token=Token.getToken()
    response = requests.post(url,params={'access_token':access_token,'receive_id':id})
    result = response.json()
    print("删除收货地址成功")
    print(result)
    return result
示例#4
0
def get_gp(self):
    url = 'http://www.test.mbalib.com/goods/goods/getGoodsListNew'
    response = requests.post(url)
    result = response.json()
    print(result)
    id = result['data'][0]['goods_id']
    goodurl = 'http://www.test.mbalib.com/goods/goods/getGoodsDetail'
    params = {'access_token': Token.getToken(), 'goods_id': id}
    esponse = requests.post(goodurl, params)
    gps = esponse.json()
    print(gps)
    return gps['data']['goods_package']
 def setUp(self):
     self.base_url = 'http://www.test.mbalib.com/goods/receive/getReceiveDetail'
     self.access_token = Token.getToken()
 def setUp(self):
     self.base_url = 'http://www.test.mbalib.com/goods/order/createOrder'
     self.accsee_token = Token.getToken()
 def setUp(self):
     self.base_url = 'http://www.test.mbalib.com/goods/goods/getGoodsListNew'
     self.accsee_token = Token.getToken()