Skip to content

Commit

Permalink
[FIX] analytic_multicurrency: Make tests independent from the running…
Browse files Browse the repository at this point in the history
… day (2)

These are 2 remaining things to make tests date-independent.
  • Loading branch information
pedrobaeza committed Apr 5, 2017
1 parent 28de073 commit 1d6c557
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions analytic_multicurrency/tests/test_analytic_lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ def test_amount_with_context_date_to(self):
'amount': -200,
'general_account_id': self.account_rcv_id.id,
})
todate = fields.Date.to_string(fields.Date.from_string(
fields.Date.today()
).replace(day=1))
todate = fields.Date.to_string(
fields.Date.from_string(fields.Date.today()) - timedelta(days=1)
)
aal2 = aal_rs.with_context(to_date=todate)
self.assertAlmostEqual(0, aal2.account_id.credit)
self.assertAlmostEqual(100, aal2.account_id.debit)
Expand Down Expand Up @@ -360,10 +360,9 @@ def test_amount_with_context_from_date_date_to(self):
self.assertAlmostEqual(200, aal2.account_id.credit)
self.assertAlmostEqual(0, aal2.account_id.debit)
self.assertAlmostEqual(-200, aal2.account_id.balance)

todate = fields.Date.to_string(fields.Date.from_string(
fields.Date.today()
).replace(day=1))
todate = fields.Date.to_string(
fields.Date.from_string(fields.Date.today()) - timedelta(days=1)
)
aal3 = aal_rs.with_context(to_date=todate)
self.assertAlmostEqual(0, aal3.account_id.credit)
self.assertAlmostEqual(100, aal3.account_id.debit)
Expand Down

0 comments on commit 1d6c557

Please sign in to comment.