diff --git a/tests/test_reports_accrual.py b/tests/test_reports_accrual.py index d6f894dd4237351a1c39436334971c1d9a04fe65..8b90dbb43bcf5c00ea39089d3dab602536b70ef2 100644 --- a/tests/test_reports_accrual.py +++ b/tests/test_reports_accrual.py @@ -75,20 +75,22 @@ class AgingRow(NamedTuple): at_cost: bc_data.Amount rt_id: Sequence[str] invoice: Sequence[str] + project: Sequence[str] @classmethod - def make_simple(cls, date, entity, at_cost, invoice, rt_id=None, orig_amount=None): + def make_simple(cls, date, entity, at_cost, invoice, + rt_id=None, orig_amount=None, project='Conservancy'): if isinstance(date, str): date = datetime.datetime.strptime(date, '%Y-%m-%d').date() if not isinstance(at_cost, tuple): at_cost = testutil.Amount(at_cost) if rt_id is None: rt_id, _, _ = invoice.partition('/') - return cls(date, [entity], orig_amount, at_cost, [rt_id], [invoice]) + return cls(date, [entity], orig_amount, at_cost, [rt_id], [invoice], [project]) def check_row_match(self, sheet_row): cells = testutil.ODSCell.from_row(sheet_row) - assert len(cells) == len(self) + assert len(cells) >= len(self) cells = iter(cells) assert next(cells).value == self.date assert next(cells).text == '\0'.join(self.entity) @@ -99,6 +101,7 @@ class AgingRow(NamedTuple): usd_cell = next(cells) assert usd_cell.value_type == 'currency' assert usd_cell.value == self.at_cost.number + assert next(cells).text == '\0'.join(self.project) for index, cell in enumerate(cells): links = cell.getElementsByType(odf.text.A) assert len(links) == len(cell.childNodes) @@ -118,7 +121,8 @@ AGING_AR = [ AgingRow.make_simple('2010-03-05', 'EarlyBird', -500, 'rt:40/400'), AgingRow.make_simple('2010-05-15', 'MatchingProgram', 1500, 'rt://ticket/515/attachments/5150'), - AgingRow.make_simple('2010-06-15', 'GrantCo', 5500, 'rt:470/4700'), + AgingRow.make_simple('2010-06-15', 'GrantCo', 5500, 'rt:470/4700', + project='Development Grant'), ] class RTClient(testutil.RTClient):