Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Fixed build issues on master. Fixes #3885
Browse files Browse the repository at this point in the history
  • Loading branch information
aandis committed Jan 13, 2016
1 parent e01fc96 commit 72e6d44
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/py/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def make_history(harness):
class TestHistory(BillingHarness):

def test_iter_payday_events(self):
now = datetime.now()
Payday().start().run()

Enterprise = self.make_team(is_approved=True)
Expand Down Expand Up @@ -66,7 +67,19 @@ def test_iter_payday_events(self):

Payday().start() # to demonstrate that we ignore any open payday?

events = list(iter_payday_events(self.db, picard))
# Make all events in the same year.
delta = '%s days' % (364 - (now - datetime(now.year, 1, 1)).days)
self.db.run("""
UPDATE paydays
SET ts_start = ts_start + interval %(delta)s
, ts_end = ts_end + interval %(delta)s;
UPDATE payments
SET timestamp = "timestamp" + interval %(delta)s;
UPDATE transfers
SET timestamp = "timestamp" + interval %(delta)s;
""", dict(delta=delta))

events = list(iter_payday_events(self.db, picard, now.year))
assert len(events) == 7
assert events[0]['kind'] == 'totals'
assert events[0]['given'] == 0
Expand Down

0 comments on commit 72e6d44

Please sign in to comment.