mirror of
https://github.com/gooba42/adventureland.git
synced 2026-10-15 10:49:27 -05:00
43 lines
972 B
Python
Executable File
43 lines
972 B
Python
Executable File
import libraries.stripe
|
|
from libraries.stripe.test.helper import (
|
|
StripeResourceTest, DUMMY_PLAN
|
|
)
|
|
|
|
|
|
class PlanTest(StripeResourceTest):
|
|
|
|
def test_create_plan(self):
|
|
libraries.stripe.Plan.create(**DUMMY_PLAN)
|
|
|
|
self.requestor_mock.request.assert_called_with(
|
|
'post',
|
|
'/v1/plans',
|
|
DUMMY_PLAN,
|
|
None
|
|
)
|
|
|
|
def test_delete_plan(self):
|
|
p = libraries.stripe.Plan(id="pl_delete")
|
|
p.delete()
|
|
|
|
self.requestor_mock.request.assert_called_with(
|
|
'delete',
|
|
'/v1/plans/pl_delete',
|
|
{},
|
|
None
|
|
)
|
|
|
|
def test_update_plan(self):
|
|
p = libraries.stripe.Plan(id="pl_update")
|
|
p.name = "Plan Name"
|
|
p.save()
|
|
|
|
self.requestor_mock.request.assert_called_with(
|
|
'post',
|
|
'/v1/plans/pl_update',
|
|
{
|
|
'name': 'Plan Name',
|
|
},
|
|
None
|
|
)
|