Skip to content

Commit 44b9966

Browse files
committed
Merge branch 'TASK-934-update-canceled-sub-handling' into TASK-934-update-canceled-sub-handling-frontend
2 parents fe94162 + 2348e96 commit 44b9966

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

kobo/apps/organizations/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def get_monthly_billing_dates(organization: Union[Organization, None]):
1212

1313
now = timezone.now().replace(tzinfo=pytz.UTC)
1414
first_of_this_month = now.replace(day=1)
15-
# Using `days=31` gets the last day of the month
16-
last_of_this_month = first_of_this_month + relativedelta(days=31)
15+
# Using `day=31` gets the last day of the month
16+
last_of_this_month = first_of_this_month + relativedelta(day=31)
1717

1818
# If no organization, just use the calendar month
1919
if not organization:

kobo/apps/stripe/tests/test_organization_usage.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ def tearDown(self):
172172

173173
def test_plan_canceled_this_month(self):
174174
"""
175-
When a user canceld their plan, they revert to the default community plan
176-
and the start date should be
175+
When a user cancels their subscription, they revert to the default community plan
176+
with a billing cycle anchored to the end date of their canceled subscription
177177
"""
178178

179179
subscription = generate_plan_subscription(self.organization, age_days=30)
@@ -198,11 +198,6 @@ def test_plan_canceled_this_month(self):
198198
assert response.data['current_month_end'] == current_billing_period_end.isoformat()
199199

200200
def test_plan_canceled_last_month(self):
201-
"""
202-
When a user cancels their plan, they revert to the default community plan
203-
with a billing cycle anchored to the end of date of their canceled plan
204-
"""
205-
206201
subscription = generate_plan_subscription(self.organization, age_days=60)
207202

208203
num_submissions = 5

0 commit comments

Comments
 (0)