Skip to content

Commit

Permalink
issue #104 - fix sample data and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jantman committed Aug 13, 2017
1 parent 14a3d9b commit 22bc7c1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
Expand Up @@ -207,7 +207,7 @@ def test_acct_table(self, selenium):
['Active?', 'True'],
['OFXGetter Config', 'None'],
['reconcile_trans', 'True'],
['negate_ofx_amounts', 'False'],
['negate_ofx_amounts', 'True'],
['ofx_cat_memo_to_name', 'False'],
[
'Interest Charge regex',
Expand Down
4 changes: 2 additions & 2 deletions biweeklybudget/tests/acceptance/models/test_account.py
Expand Up @@ -54,7 +54,7 @@ def test_credit_one(self, testdb):
assert latest_interest.account_id == 3
assert latest_interest.fitid == 'T3'
assert latest_interest.account_amount == Decimal('16.25')
assert latest_interest.statement_id == 4
assert latest_interest.statement_id == 6

def test_credit_two(self, testdb):
acct = testdb.query(Account).get(4)
Expand All @@ -64,4 +64,4 @@ def test_credit_two(self, testdb):
assert latest_interest.account_id == 4
assert latest_interest.fitid == '001'
assert latest_interest.account_amount == Decimal('28.53')
assert latest_interest.statement_id == 6
assert latest_interest.statement_id == 7
Expand Up @@ -46,8 +46,9 @@ def test_credit_one(self, testdb):
trans = testdb.query(OFXTransaction).get((3, 'T2'))
assert trans is not None
assert trans.amount == Decimal('52.00')
assert trans.statement_id == 4
assert trans.statement_id == 6
assert trans.statement.filename == '/stmt/CreditOne/0'
res = trans.first_statement_by_date
assert res is not None
assert res.id == 4
assert res.filename == '/stmt/CreditOne/3'
26 changes: 13 additions & 13 deletions biweeklybudget/tests/fixtures/sampledata.py
Expand Up @@ -404,16 +404,16 @@ def _credit_one(self):
statements = [
OFXStatement(
account=acct,
filename='/stmt/CreditOne/0',
file_mtime=(self.dt - timedelta(hours=13)),
filename='/stmt/CreditOne/3',
file_mtime=(self.dt - timedelta(days=1)),
currency='USD',
bankid='CreditOne',
acct_type='Credit',
acctid='CreditOneAcctId',
type='Credit',
as_of=(self.dt - timedelta(hours=13)),
ledger_bal=-952.06,
ledger_bal_as_of=(self.dt - timedelta(hours=13)),
as_of=(self.dt - timedelta(days=1)),
ledger_bal=-435.29,
ledger_bal_as_of=(self.dt - timedelta(days=1)),
),
OFXStatement(
account=acct,
Expand All @@ -430,23 +430,23 @@ def _credit_one(self):
),
OFXStatement(
account=acct,
filename='/stmt/CreditOne/3',
file_mtime=(self.dt - timedelta(days=1)),
filename='/stmt/CreditOne/0',
file_mtime=(self.dt - timedelta(hours=13)),
currency='USD',
bankid='CreditOne',
acct_type='Credit',
acctid='CreditOneAcctId',
type='Credit',
as_of=(self.dt - timedelta(days=1)),
ledger_bal=-435.29,
ledger_bal_as_of=(self.dt - timedelta(days=1)),
as_of=(self.dt - timedelta(hours=13)),
ledger_bal=-952.06,
ledger_bal_as_of=(self.dt - timedelta(hours=13)),
)
]
transactions = {
0: [
OFXTransaction(
account=acct,
statement=statements[0],
statement=statements[2],
fitid='T1',
trans_type='Purchase',
date_posted=(self.dt - timedelta(hours=22)),
Expand All @@ -460,7 +460,7 @@ def _credit_one(self):
),
OFXTransaction(
account=acct,
statement=statements[0],
statement=statements[2],
fitid='T2',
trans_type='credit',
date_posted=(self.dt - timedelta(days=2)),
Expand All @@ -471,7 +471,7 @@ def _credit_one(self):
),
OFXTransaction(
account=acct,
statement=statements[0],
statement=statements[2],
fitid='T3',
trans_type='debit',
date_posted=(self.dt - timedelta(hours=13)),
Expand Down

0 comments on commit 22bc7c1

Please sign in to comment.