代码拉取完成,页面将自动刷新
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)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。