本文整理匯總了Python中recurly.Plan.setup_fee_accounting_code方法的典型用法代碼示例。如果您正苦於以下問題:Python Plan.setup_fee_accounting_code方法的具體用法?Python Plan.setup_fee_accounting_code怎麽用?Python Plan.setup_fee_accounting_code使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類recurly.Plan
的用法示例。
在下文中一共展示了Plan.setup_fee_accounting_code方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_plan
# 需要導入模塊: from recurly import Plan [as 別名]
# 或者: from recurly.Plan import setup_fee_accounting_code [as 別名]
def test_plan(self):
plan_code = "plan%s" % self.test_id
with self.mock_request("plan/does-not-exist.xml"):
self.assertRaises(NotFoundError, Plan.get, plan_code)
plan = Plan(
plan_code=plan_code,
name="Mock Plan",
setup_fee_in_cents=Money(0),
unit_amount_in_cents=Money(1000),
total_billing_cycles=10,
)
with self.mock_request("plan/created.xml"):
plan.save()
try:
self.assertEqual(plan.plan_code, plan_code)
with self.mock_request("plan/exists.xml"):
same_plan = Plan.get(plan_code)
self.assertEqual(same_plan.plan_code, plan_code)
self.assertEqual(same_plan.name, "Mock Plan")
self.assertEqual(same_plan.total_billing_cycles, 10)
plan.plan_interval_length = 2
plan.plan_interval_unit = "months"
plan.unit_amount_in_cents = Money(USD=2000)
plan.setup_fee_in_cents = Money(USD=200)
plan.setup_fee_accounting_code = "Setup Fee AC"
with self.mock_request("plan/updated.xml"):
plan.save()
finally:
with self.mock_request("plan/deleted.xml"):
plan.delete()
"""Test taxed plan"""
with self.mock_request("plan/show-taxed.xml"):
plan = Plan.get(plan_code)
self.assertTrue(plan.tax_exempt)