34 def test_assignlots(self):
35 abc = GncCommodity(self.book, 'ABC Fund',
36 'COMMODITY','ABC','ABC',100000)
37 self.table.insert(abc)
38 self.account.SetCommodity(abc)
39
41 other.SetCommodity(self.currency)
42
43 tx = Transaction(self.book)
44 tx.BeginEdit()
45 tx.SetCurrency(self.currency)
46 tx.SetDateEnteredSecs(datetime.now())
47 tx.SetDatePostedSecs(datetime.now())
48
49 s1a = Split(self.book)
50 s1a.SetParent(tx)
51 s1a.SetAccount(self.account)
54
55 s1b = Split(self.book)
56 s1b.SetParent(tx)
57 s1b.SetAccount(other)
60
61 s2a = Split(self.book)
62 s2a.SetParent(tx)
63 s2a.SetAccount(self.account)
66
67 s2b = Split(self.book)
68 s2b.SetParent(tx)
69 s2b.SetAccount(other)
72
73 tx.CommitEdit()
74
75 self.account.ScrubLots()
76 self.assertEqual(len(self.account.GetLotList()),1)
77
The primary numeric class for representing amounts and values.