Skip to content

Commit

Permalink
Merge branch 'TASK-934-update-canceled-sub-handling' into TASK-934-up…
Browse files Browse the repository at this point in the history
…date-canceled-sub-handling-frontend
  • Loading branch information
jamesrkiger committed Aug 8, 2024
2 parents fe94162 + 2348e96 commit 44b9966
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions kobo/apps/organizations/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def get_monthly_billing_dates(organization: Union[Organization, None]):

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

# If no organization, just use the calendar month
if not organization:
Expand Down
9 changes: 2 additions & 7 deletions kobo/apps/stripe/tests/test_organization_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def tearDown(self):

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

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

def test_plan_canceled_last_month(self):
"""
When a user cancels their plan, they revert to the default community plan
with a billing cycle anchored to the end of date of their canceled plan
"""

subscription = generate_plan_subscription(self.organization, age_days=60)

num_submissions = 5
Expand Down

0 comments on commit 44b9966

Please sign in to comment.