3from gnucash
import Book, Account, Split, GncCommodity, GncNumeric, \
20 def test_online_id(self):
21 ONLINE_ID =
"061000104:0123456789:CHECKING"
30 SPLIT = Split(self.
book)
34 def test_assignlots(self):
35 abc = GncCommodity(self.
book,
'ABC Fund',
36 'COMMODITY',
'ABC',
'ABC',100000)
37 self.
table.insert(abc)
40 other = Account(self.
book)
43 tx = Transaction(self.
book)
46 tx.SetDateEnteredSecs(datetime.now())
47 tx.SetDatePostedSecs(datetime.now())
49 s1a = Split(self.
book)
52 s1a.SetAmount(GncNumeric(1.3))
53 s1a.SetValue(GncNumeric(100.0))
55 s1b = Split(self.
book)
58 s1b.SetAmount(GncNumeric(-100.0))
59 s1b.SetValue(GncNumeric(-100.0))
61 s2a = Split(self.
book)
64 s2a.SetAmount(GncNumeric(-1.3))
65 s2a.SetValue(GncNumeric(-100.0))
67 s2b = Split(self.
book)
70 s2b.SetAmount(GncNumeric(100.0))
71 s2b.SetValue(GncNumeric(100.0))