You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.9 KiB
28 lines
1.9 KiB
|
1 week ago
|
#-*-coding:utf-8-*-
|
||
|
|
_author_ = 'Emily'
|
||
|
|
#@Time:2021/1/13 16:57
|
||
|
|
|
||
|
|
|
||
|
|
import unittest
|
||
|
|
import requests
|
||
|
|
|
||
|
|
class finishSu(unittest.TestCase):
|
||
|
|
def setUp(self):
|
||
|
|
self.post_url = 'http://10.199.213.157:8080/posOrder/finishOrder'
|
||
|
|
self.header = {'Content-Type': 'application/json;charset=utf-8'}
|
||
|
|
|
||
|
|
def test_finishSuccess(self):
|
||
|
|
payload = '{"posBill":{"billCode":"84903000002950","attendant":"1001","billAmount":1,"discountAmount":0,"realAmount":1,"reportDate":"2021-01-13","channelCode":"POS","giveMoney":0,"haveGiveMeGoods":false,"cargoRackId":"10","cashDeviceCode":"leying","hasTicket":"N","hasPreferential":"N"},"posBillDetail":[{"id":477799,"billCode":"84903000002950","goodsId":1243968,"goodsCode":"99040003","goodsName":"xw开心小食","price":1,"quantity":1,"categoryId":551,"categoryCode":"9904","categoryName":"xw新年礼包","goodsAmount":1,"discountAmount":0,"giveAmount":0,"realAmount":1,"reportDate":"2021-01-13","cashDeviceCode":"90","attendant":"","discountID":0,"goodsAttribute":"单品","source":"0","giveReason":"","extraMoney":0,"goodsTypeCode":"ERP_ITEMINFO_SALES_SP","unitName":"大A","comboDetails":[],"memo":"","memoPrice":0,"ifAddPriceItem":"N","relAddPriceItemId":477792,"addPriceItemStyle":"0","retail_sell_is_mandiscount":0}],"discountDetails":[],"paymentList":[{"paymentCode":"bank","paymentAmount":"1.00","operateTime":"2021-01-13 17:10:58","billDetailID":477792,"thirdName":"","thirdType":"","thirdOrder":"","thirdCode":"","realityAmount":0,"preferentialAmount":0,"realAmount":"","faceAmount":"","expireDate":""}]}'
|
||
|
|
# payload1 = payload.encode("utf-8").decode("latin1")
|
||
|
|
rsp = requests.post(self.post_url, headers=self.header,data=payload)
|
||
|
|
print(rsp.text)
|
||
|
|
result = rsp.json()
|
||
|
|
print("打印结果",result)
|
||
|
|
self.assertEqual(result['status'], 0, msg='请求成功')
|
||
|
|
|
||
|
|
|
||
|
|
def tearDown(self):
|
||
|
|
pass
|
||
|
|
|
||
|
|
if __name__ == '__main__':
|
||
|
|
unittest.main()
|