Beispiel #1
0
    def test_BadPastDue(self):
        """
        This was a bug I noticed in the receivables page.
        """
        acc = Account()

        acc.events << Event(event="charge", amount=20, posted="09/15/2002")
        acc.events << Event(event="charge", amount= 4, posted="09/16/2002")
        acc.events << Event(event="payment", amount=20,posted="09/19/2002")
        
        assert acc.balance() == 4, acc.balance()
        self.assertEquals(acc.amountPastDue("09/20/2002"), 4)
        aging = acc.aging()
        assert len(aging)==1
        assert aging[0].value == 4
Beispiel #2
0
    def oldAccount(self):
        acc = Account()
        acc.events << Event(event="charge", amount=10, posted="1/1/2002")
        acc.events << Event(event="charge", amount=10, posted="2/1/2002")
        acc.events << Event(event="credit", amount=5,  posted="2/2/2002")

        acc.events << Event(event="charge", amount=10, posted="3/1/2002")
        acc.events << Event(event="charge", amount=10, posted="4/1/2002")
        acc.events << Event(event="credit", amount=20, posted="4/2/2002")
        acc.events << Event(event="charge", amount=10, posted="5/1/2002")

        assert acc.balance() == 25
        return acc