Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion quickbooks/objects/deposit.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def __init__(self):
self.LineNum = 0
self.Description = ""
self.Amount = 0
self.DetailType = "DepositLineDetail"
self.LinkedTxn = []
self.CustomField = []

Expand Down
20 changes: 20 additions & 0 deletions tests/unit/objects/test_deposit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from quickbooks import QuickBooks
from quickbooks.objects.deposit import Deposit, DepositLine, CashBackInfo, DepositLineDetail
from quickbooks.objects.base import LinkedTxn


class DepositTests(unittest.TestCase):
Expand All @@ -26,6 +27,25 @@ def test_unicode(self):

self.assertEqual(str(deposit), "100")

def test_init_no_detail_type(self):
deposit_line = DepositLine()
self.assertFalse(hasattr(deposit_line, 'DetailType'))

def test_to_dict_with_linked_txn(self):
deposit_line = DepositLine()
deposit_line.Amount = 100

linked_txn = LinkedTxn()
linked_txn.TxnId = "123"
linked_txn.TxnType = "Payment"
linked_txn.TxnLineId = 0
deposit_line.LinkedTxn.append(linked_txn)

result = deposit_line.to_dict()
self.assertNotIn('DetailType', result)
self.assertEqual(result['Amount'], 100)
self.assertEqual(len(result['LinkedTxn']), 1)


class CashBackInfoTests(unittest.TestCase):
def test_init(self):
Expand Down