GnuCash fec5643+
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
test_price_and_wrapping.TestAccountCurrencyOrParent Class Reference
Inheritance diagram for test_price_and_wrapping.TestAccountCurrencyOrParent:

Public Member Functions

 setUp (self)
 
 tearDown (self)
 
 test_get_currency_or_parent_returns_commodity (self)
 

Data Fields

 ses
 
 book
 
 usd
 
 acct
 

Detailed Description

Verify Account.get_currency_or_parent() returns GncCommodity.

Definition at line 284 of file test_price_and_wrapping.py.

Member Function Documentation

◆ setUp()

test_price_and_wrapping.TestAccountCurrencyOrParent.setUp (   self)

Definition at line 287 of file test_price_and_wrapping.py.

287 def setUp(self):
288 self.ses = Session()
289 self.book = self.ses.get_book()
290 table = self.book.get_table()
291 self.usd = table.lookup("CURRENCY", "USD")
292
293 root = self.book.get_root_account()
294 self.acct = Account(self.book)
295 self.acct.SetCommodity(self.usd)
296 root.append_child(self.acct)
297
STRUCTS.

◆ tearDown()

test_price_and_wrapping.TestAccountCurrencyOrParent.tearDown (   self)

Definition at line 298 of file test_price_and_wrapping.py.

298 def tearDown(self):
299 self.ses.end()
300

◆ test_get_currency_or_parent_returns_commodity()

test_price_and_wrapping.TestAccountCurrencyOrParent.test_get_currency_or_parent_returns_commodity (   self)

Definition at line 301 of file test_price_and_wrapping.py.

301 def test_get_currency_or_parent_returns_commodity(self):
302 result = self.acct.get_currency_or_parent()
303 self.assertIsNotNone(result)
304 self.assertIsInstance(result, GncCommodity)
305
306
307# ---------------------------------------------------------------------------
308# Test: GncCommodity.obtain_twin wrapping
309# ---------------------------------------------------------------------------

Field Documentation

◆ acct

test_price_and_wrapping.TestAccountCurrencyOrParent.acct

Definition at line 294 of file test_price_and_wrapping.py.

◆ book

test_price_and_wrapping.TestAccountCurrencyOrParent.book

Definition at line 289 of file test_price_and_wrapping.py.

◆ ses

test_price_and_wrapping.TestAccountCurrencyOrParent.ses

Definition at line 288 of file test_price_and_wrapping.py.

◆ usd

test_price_and_wrapping.TestAccountCurrencyOrParent.usd

Definition at line 291 of file test_price_and_wrapping.py.


The documentation for this class was generated from the following file: