234 def setUp(self):
235 self.ses = Session()
236 self.book = self.ses.get_book()
237 table = self.book.get_table()
238 currency = table.lookup("CURRENCY", "USD")
239
240 root = self.book.get_root_account()
242 acct.SetCommodity(currency)
243 root.append_child(acct)
244
246 other.SetCommodity(currency)
247 root.append_child(other)
248
249 tx = Transaction(self.book)
250 tx.BeginEdit()
251 tx.SetCurrency(currency)
252 tx.SetDateEnteredSecs(datetime.now())
253 tx.SetDatePostedSecs(datetime.now())
254
255 self.split = Split(self.book)
256 self.split.SetParent(tx)
257 self.split.SetAccount(acct)
260
261 s2 = Split(self.book)
262 s2.SetParent(tx)
263 s2.SetAccount(other)
266
267 tx.CommitEdit()
268
The primary numeric class for representing amounts and values.