From adb731f707b8ff2a119322131578f10f75875f99 Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Wed, 31 Jul 2024 10:15:40 -0300 Subject: [PATCH] Fix test comparison (#1955) --- tests/manager/api/test_overdrive.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/manager/api/test_overdrive.py b/tests/manager/api/test_overdrive.py index e378691ce..a2a167f53 100644 --- a/tests/manager/api/test_overdrive.py +++ b/tests/manager/api/test_overdrive.py @@ -2663,17 +2663,20 @@ def test_sync_patron_activity_creates_local_loans( # We have recorded a new DeliveryMechanism associated with # each loan. - mechanisms = [] - for loan in loans.values(): - if loan.fulfillment: - mechanism = loan.fulfillment.delivery_mechanism - mechanisms.append((mechanism.content_type, mechanism.drm_scheme)) - assert [ + mechanisms = { + ( + loan.fulfillment.delivery_mechanism.content_type, + loan.fulfillment.delivery_mechanism.drm_scheme, + ) + for loan in loans.values() + if loan.fulfillment + } + assert { (Representation.EPUB_MEDIA_TYPE, DeliveryMechanism.NO_DRM), (Representation.EPUB_MEDIA_TYPE, DeliveryMechanism.ADOBE_DRM), (Representation.PDF_MEDIA_TYPE, DeliveryMechanism.ADOBE_DRM), (Representation.EPUB_MEDIA_TYPE, DeliveryMechanism.ADOBE_DRM), - ] == mechanisms + } == mechanisms # There are no holds. assert {} == holds