1717 most_active_org_in_time_period ,
1818 subscription_is_active
1919)
20- from perma .utils import pp_date_from_post , tz_datetime , first_day_of_next_month , today_next_year , years_ago_today
20+ from perma .utils import pp_date_from_post , tz_datetime , first_day_of_next_month , today_next_month , today_next_year , years_ago_today
2121
2222from conftest import GENESIS
2323import pytest
@@ -527,7 +527,7 @@ def test_annotate_tier_monthly_no_subscription_first_of_month(customers):
527527
528528def test_annotate_tier_monthly_no_subscription_mid_month (customers ):
529529 now = GENESIS .replace (day = 16 )
530- next_month = first_day_of_next_month (now )
530+ next_month = today_next_month (now )
531531 next_year = today_next_year (now )
532532 subscription = None
533533 for customer in customers :
@@ -539,8 +539,8 @@ def test_annotate_tier_monthly_no_subscription_mid_month(customers):
539539 customer .annotate_tier (tier , subscription , now , next_month , next_year )
540540 assert tier ['type' ] == 'upgrade'
541541 assert tier ['link_limit_effective_timestamp' ] == now .timestamp ()
542- assert Decimal (tier ['todays_charge' ]) == (customer .base_rate * tier ['rate_ratio' ] / 31 * 16 ).quantize (Decimal ('.01' ))
543- assert tier ['recurring_amount' ] ! = tier ['todays_charge' ]
542+ assert Decimal (tier ['todays_charge' ]) == (customer .base_rate * tier ['rate_ratio' ]).quantize (Decimal ('.01' ))
543+ assert tier ['recurring_amount' ] = = tier ['todays_charge' ]
544544 assert tier ['next_payment' ] == next_month
545545
546546
@@ -549,7 +549,7 @@ def test_annotate_tier_monthly_no_subscription_last_of_month(is_active, customer
549549 is_active .return_value = True
550550
551551 now = GENESIS .replace (day = 31 )
552- next_month = first_day_of_next_month (now )
552+ next_month = today_next_month (now )
553553 next_year = today_next_year (now )
554554 subscription = None
555555 for customer in customers :
@@ -561,8 +561,8 @@ def test_annotate_tier_monthly_no_subscription_last_of_month(is_active, customer
561561 customer .annotate_tier (tier , subscription , now , next_month , next_year )
562562 assert tier ['type' ] == 'upgrade'
563563 assert tier ['link_limit_effective_timestamp' ] == now .timestamp ()
564- assert Decimal (tier ['todays_charge' ]) == (customer .base_rate * tier ['rate_ratio' ] / 31 ).quantize (Decimal ('.01' ))
565- assert tier ['recurring_amount' ] ! = tier ['todays_charge' ]
564+ assert Decimal (tier ['todays_charge' ]) == (customer .base_rate * tier ['rate_ratio' ]).quantize (Decimal ('.01' ))
565+ assert tier ['recurring_amount' ] = = tier ['todays_charge' ]
566566 assert tier ['next_payment' ] == next_month
567567
568568
0 commit comments