Skip to content

Commit bb67ece

Browse files
committed
Added test case for an empty renewal count in loans migrator
1 parent 88d1bf8 commit bb67ece

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_legacy_loan.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,28 @@ def test_init_tz_5(): # Test dates with(out) DST
163163
)
164164

165165

166+
def test_init_renewal_count_is_missing():
167+
loan_dict = {
168+
"item_barcode": "the barcode with trailing space ",
169+
"patron_barcode": " the barcode with leading space",
170+
"due_date": "20220113 16:00",
171+
"out_date": "20220113 14:00",
172+
"next_item_status": "Checked out",
173+
}
174+
tenant_timezone = ZoneInfo("UTC")
175+
migration_report = MigrationReport()
176+
legacy_loan = LegacyLoan(
177+
loan_dict, "", migration_report, tenant_timezone)
178+
assert legacy_loan.renewal_count == 0
179+
180+
166181
def test_init_renewal_count_is_empty():
167182
loan_dict = {
168183
"item_barcode": "the barcode with trailing space ",
169184
"patron_barcode": " the barcode with leading space",
170185
"due_date": "20220113 16:00",
171186
"out_date": "20220113 14:00",
187+
"renewal_count": "",
172188
"next_item_status": "Checked out",
173189
}
174190
tenant_timezone = ZoneInfo("UTC")

0 commit comments

Comments
 (0)