Exemplo n.º 1
0
    def test_commodity_quantity(self, book_investment):
        """
        Tests listing the commodity quantity in the account.
        """
        security = book_investment.get(Commodity, mnemonic="VEUR")

        total = Decimal(0)

        for account in security.accounts:
            # exclude Trading accouns explicitly.
            if account.type == "TRADING":
                continue

            balance = account.get_balance()

            # print(account.fullname, balance)
            total += balance

        # print("Balance:", total_balance)
        assert total == Decimal(13)
Exemplo n.º 2
0
    def test_commodity_quantity(self, book_investment):
        """
        Tests listing the commodity quantity in the account.
        """
        security = book_investment.get(Commodity, mnemonic="VEUR")

        total = Decimal(0)

        for account in security.accounts:
            # exclude Trading accouns explicitly.
            if account.type == "TRADING":
                continue

            balance = account.get_balance()

            # print(account.fullname, balance)
            total += balance

        # print("Balance:", total_balance)
        assert total == Decimal(13)