From 8326bd68d92b096c371047c3ad5d95f61f9e07a7 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Fri, 15 Feb 2019 11:47:27 -0500 Subject: [PATCH] benevity: Version the current importer. The report format has changed slightly in 2019. --- import2ledger/importers/benevity.py | 5 ++++- tests/data/{Benevity.csv => Benevity2018.csv} | 0 tests/data/imports.yml | 9 +++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) rename tests/data/{Benevity.csv => Benevity2018.csv} (100%) diff --git a/import2ledger/importers/benevity.py b/import2ledger/importers/benevity.py index 8b29ebd..aff8171 100644 --- a/import2ledger/importers/benevity.py +++ b/import2ledger/importers/benevity.py @@ -1,7 +1,10 @@ from . import _csv from .. import strparse -class DonationsImporter(_csv.CSVImporterBase): +class Donations2018Importer(_csv.CSVImporterBase): + ENTRY_SEED = { + 'ledger template': 'benevity donations ledger entry', + } HEADER_FIELDS = { 'Currency': 'currency', 'Disbursement ID': 'disbursement_id', diff --git a/tests/data/Benevity.csv b/tests/data/Benevity2018.csv similarity index 100% rename from tests/data/Benevity.csv rename to tests/data/Benevity2018.csv diff --git a/tests/data/imports.yml b/tests/data/imports.yml index 0303dd2..f058cc3 100644 --- a/tests/data/imports.yml +++ b/tests/data/imports.yml @@ -274,8 +274,8 @@ amount: !!python/object/apply:decimal.Decimal ["-.08"] currency: USD -- source: Benevity.csv - importer: benevity.DonationsImporter +- source: Benevity2018.csv + importer: benevity.Donations2018Importer expect: - date: !!python/object/apply:datetime.date [2017, 10, 28] currency: USD @@ -289,6 +289,7 @@ comment: "" frequency: One-time transaction_id: 67890QWERT + ledger template: benevity donations ledger entry - date: !!python/object/apply:datetime.date [2017, 10, 30] currency: USD disbursement_id: ABCDE12345 @@ -301,6 +302,7 @@ comment: "" frequency: One-time transaction_id: 67890WERTY + ledger template: benevity donations ledger entry - date: !!python/object/apply:datetime.date [2017, 10, 19] currency: USD disbursement_id: ABCDE12345 @@ -313,6 +315,7 @@ comment: "" frequency: Unknown transaction_id: 67890ERTYU + ledger template: benevity donations ledger entry - date: !!python/object/apply:datetime.date [2017, 10, 19] currency: USD disbursement_id: ABCDE12345 @@ -325,6 +328,7 @@ comment: "" frequency: Unknown transaction_id: 67890RTYUI + ledger template: benevity donations ledger entry - date: !!python/object/apply:datetime.date [2017, 10, 19] currency: USD disbursement_id: ABCDE12345 @@ -337,6 +341,7 @@ comment: "" frequency: Recurring transaction_id: 67890TYUIO + ledger template: benevity donations ledger entry - source: BrightFunds.xls importer: brightfunds.DonorReportImporter