diff --git a/tests/test_reports_related_postings.py b/tests/test_reports_related_postings.py index 2dda881..a918619 100644 --- a/tests/test_reports_related_postings.py +++ b/tests/test_reports_related_postings.py @@ -27,13 +27,8 @@ from . import testutil from conservancy_beancount import data from conservancy_beancount.reports import core -def date_seq(date=testutil.FY_MID_DATE, step=1): - while True: - yield date - date = date + datetime.timedelta(days=step) - def accruals_and_payments(acct, src_acct, dst_acct, start_date, *amounts): - dates = date_seq(start_date) + dates = testutil.date_seq(start_date) for amt, currency in amounts: yield testutil.Transaction(date=next(dates), postings=[ (acct, amt, currency), diff --git a/tests/testutil.py b/tests/testutil.py index f4ef5e8..7eaf304 100644 --- a/tests/testutil.py +++ b/tests/testutil.py @@ -55,6 +55,11 @@ def combine_values(*value_seqs): stop, ) +def date_seq(date=FY_MID_DATE, step=1): + while True: + yield date + date += datetime.timedelta(days=step) + def parse_date(s, fmt='%Y-%m-%d'): return datetime.datetime.strptime(s, fmt).date()