def test_onDue(self): """ onDue should post a charge and update nextDue. """ self.sub = fakeSubscription() a = Account() self.sub.account = a self.sub.service = "service" self.sub.username = "******" self.sub.nextDue = CUSTOMER_SIGNUP_DATE assert len(a.events) == 0 self.sub.catchup() assert len(a.events) == 1 assert a.events[0].posted == CUSTOMER_SIGNUP_DATE assert a.events[0].maturity == SECOND_STATEMENT_DATE assert a.events[0].note == "1-month service [username]" assert self.sub.nextDue == SECOND_STATEMENT_DATE, self.sub.nextDue
def setUp(self): self.sub = fakeSubscription() self.today, duckbill.TODAY = duckbill.TODAY, CUSTOMER_SIGNUP_DATE