Exemplo n.º 1
0
    def test_get_gl_transactions_checking(self):
        trans = Cashflow(
            ext_account=ExternalAccount.objects.get(label="CHK"),
            post_date=datetime.date(2015, 1, 1),
            description="test",
            trans_type=Account.objects.get(id="3000"),
            amount="100.2",
            counterparty=Counterparty.objects.get(id="test_cp"),
        )

        transactions = trans.get_gl_transactions()
        self.assertEqual(len(transactions), 1)
        lines = transactions[0]["lines"]
        self.assertEqual(len(lines), 2)

        self.assertEqual(set([(self.chk, 100.2, self.cp1), (self.ap, -100.2, self.cp2)]), set(lines))