File diff e79877ee6a3f → 701ccdc19250
tests/test_data_is_opening_balance_txn.py
Show inline comments
...
 
@@ -20,26 +20,26 @@ import pytest
 

	
 
from . import testutil
 

	
 
from conservancy_beancount import data
 

	
 
def test_typical_opening():
 
    txn = testutil.Transaction.opening_balance()
 
    txn = testutil.OpeningBalance()
 
    assert data.is_opening_balance_txn(txn)
 

	
 
def test_multiacct_opening():
 
    txn = testutil.Transaction(postings=[
 
        ('Assets:Receivable:Accounts', 100),
 
        (next(testutil.OPENING_EQUITY_ACCOUNTS), -100),
 
        ('Liabilities:Payable:Accounts', -150),
 
        (next(testutil.OPENING_EQUITY_ACCOUNTS), 150),
 
    ])
 
    assert data.is_opening_balance_txn(txn)
 

	
 
def test_opening_with_fx():
 
    txn = testutil.Transaction.opening_balance()
 
    txn = testutil.OpeningBalance()
 
    equity_post = txn.postings[-1]
 
    txn.postings[-1] = equity_post._replace(
 
        units=testutil.Amount(equity_post.units.number * Decimal('.9'), 'EUR'),
 
        cost=testutil.Cost('1.11111'),
 
    )
 
    assert data.is_opening_balance_txn(txn)