Calculate status the same way as old portal
This commit is contained in:
parent
787fb063d1
commit
f4af053c91
|
@ -142,6 +142,14 @@ class TestCalcStatus(TestCase):
|
||||||
self.assertEqual(status, 'Current')
|
self.assertEqual(status, 'Current')
|
||||||
self.assertEqual(former, False)
|
self.assertEqual(former, False)
|
||||||
|
|
||||||
|
def test_calc_member_status_1_month(self):
|
||||||
|
expire_date = utils.today_alberta_tz() + relativedelta.relativedelta(months=1)
|
||||||
|
|
||||||
|
status, former = utils.calc_member_status(expire_date)
|
||||||
|
|
||||||
|
self.assertEqual(status, 'Current')
|
||||||
|
self.assertEqual(former, False)
|
||||||
|
|
||||||
def test_calc_member_status_90_days(self):
|
def test_calc_member_status_90_days(self):
|
||||||
expire_date = utils.today_alberta_tz() + datetime.timedelta(days=90)
|
expire_date = utils.today_alberta_tz() + datetime.timedelta(days=90)
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,7 @@ def calc_member_status(expire_date, fake_date=None):
|
||||||
|
|
||||||
difference = num_months_difference(expire_date, today)
|
difference = num_months_difference(expire_date, today)
|
||||||
|
|
||||||
#if today + datetime.timedelta(days=29) < expire_date:
|
if today + timedelta(days=29) < expire_date:
|
||||||
if difference >= 1:
|
|
||||||
return 'Prepaid', False
|
return 'Prepaid', False
|
||||||
elif difference <= -3:
|
elif difference <= -3:
|
||||||
return 'Overdue', True
|
return 'Overdue', True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user