GnuCash c935c2f+
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 283 of file test_price_and_wrapping.py.

Member Function Documentation

◆ setUp()

test_price_and_wrapping.TestAccountCurrencyOrParent.setUp (   self)

Definition at line 286 of file test_price_and_wrapping.py.

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

◆ tearDown()

test_price_and_wrapping.TestAccountCurrencyOrParent.tearDown (   self)

Definition at line 297 of file test_price_and_wrapping.py.

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

◆ test_get_currency_or_parent_returns_commodity()

test_price_and_wrapping.TestAccountCurrencyOrParent.test_get_currency_or_parent_returns_commodity (   self)

Definition at line 300 of file test_price_and_wrapping.py.

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

Field Documentation

◆ acct

test_price_and_wrapping.TestAccountCurrencyOrParent.acct

Definition at line 293 of file test_price_and_wrapping.py.

◆ book

test_price_and_wrapping.TestAccountCurrencyOrParent.book

Definition at line 288 of file test_price_and_wrapping.py.

◆ ses

test_price_and_wrapping.TestAccountCurrencyOrParent.ses

Definition at line 287 of file test_price_and_wrapping.py.

◆ usd

test_price_and_wrapping.TestAccountCurrencyOrParent.usd

Definition at line 290 of file test_price_and_wrapping.py.


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