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