From ceb4c00b695884842baf2ee40949f6e151fd3203 Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Tue, 5 Sep 2023 15:11:32 -0300 Subject: [PATCH] Fix another test --- tests/api/admin/test_opds.py | 59 +----------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/tests/api/admin/test_opds.py b/tests/api/admin/test_opds.py index fc8889befc..9d0b31f4d7 100644 --- a/tests/api/admin/test_opds.py +++ b/tests/api/admin/test_opds.py @@ -3,8 +3,7 @@ from api.admin.opds import AdminAnnotator, AdminFeed from api.opds import AcquisitionFeed from core.lane import Pagination -from core.model import DataSource, ExternalIntegration, Measurement -from core.model.configuration import ExternalIntegrationLink +from core.model import DataSource, Measurement from tests.fixtures.database import DatabaseTransactionFixture @@ -130,62 +129,6 @@ def test_feed_includes_edit_link(self, db: DatabaseTransactionFixture): [edit_link] = [x for x in entry["links"] if x["rel"] == "edit"] assert lp.identifier.identifier in edit_link["href"] - def test_feed_includes_change_cover_link(self, db: DatabaseTransactionFixture): - work = db.work(with_open_access_download=True) - lp = work.license_pools[0] - library = db.default_library() - - feed = AcquisitionFeed( - db.session, - "test", - "url", - [work], - AdminAnnotator(None, library, test_mode=True), - ) - [entry] = feedparser.parse(str(feed))["entries"] - - # Since there's no storage integration, the change cover link isn't included. - assert [] == [ - x - for x in entry["links"] - if x["rel"] == "http://librarysimplified.org/terms/rel/change_cover" - ] - - # There is now a covers storage integration that is linked to the external - # integration for a collection that the work is in. It will use that - # covers mirror and the change cover link is included. - storage = db.external_integration( - ExternalIntegration.S3, ExternalIntegration.STORAGE_GOAL - ) - storage.username = "user" - storage.password = "pass" - - collection = db.collection() - purpose = ExternalIntegrationLink.COVERS - external_integration_link = db.external_integration_link( - integration=collection._external_integration, - other_integration=storage, - purpose=purpose, - ) - library.collections.append(collection) - work = db.work(with_open_access_download=True, collection=collection) - lp = work.license_pools[0] - feed = AcquisitionFeed( - db.session, - "test", - "url", - [work], - AdminAnnotator(None, library, test_mode=True), - ) - [entry] = feedparser.parse(str(feed))["entries"] - - [change_cover_link] = [ - x - for x in entry["links"] - if x["rel"] == "http://librarysimplified.org/terms/rel/change_cover" - ] - assert lp.identifier.identifier in change_cover_link["href"] - def test_suppressed_feed(self, db: DatabaseTransactionFixture): # Test the ability to show a paginated feed of suppressed works.