Ai
1 Star 0 Fork 0

Adolph/shopify_python_api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
refund_test.py 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
Anmol Gulati 提交于 2018-05-30 14:40 +08:00 . Implement refund calculation for an order
import shopify
from test.test_helper import TestCase
class RefundTest(TestCase):
def setUp(self):
super(RefundTest, self).setUp()
self.fake("orders/450789469/refunds/509562969", method='GET', body=self.load_fixture('refund'))
def test_should_find_a_specific_refund(self):
refund = shopify.Refund.find(509562969, order_id=450789469)
self.assertEqual("209.00", refund.transactions[0].amount)
def test_calculate_refund_for_order(self):
self.fake(
"orders/450789469/refunds/calculate",
method="POST",
code=201,
body=self.load_fixture('refund_calculate'),
headers={'Content-type': 'application/json'},
)
refund = shopify.Refund.calculate(
order_id=450789469,
refund_line_items=[{'line_item_id': 518995019, 'quantity': 1}]
)
self.assertEqual("suggested_refund", refund.transactions[0].kind)
self.assertEqual("41.94", refund.transactions[0].amount)
self.assertEqual(518995019, refund.refund_line_items[0].line_item_id)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chen_guo_hong/shopify_python_api.git
git@gitee.com:chen_guo_hong/shopify_python_api.git
chen_guo_hong
shopify_python_api
shopify_python_api
master

搜索帮助