python3 compatibility + webapp to flask refactoring

This commit is contained in:
Kaan Soral
2024-01-27 20:37:44 +03:00
parent 5180a9c31c
commit 53b3de28ab
81 changed files with 11213 additions and 1085 deletions
+42
View File
@@ -0,0 +1,42 @@
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
)