diff --git a/src/palace/manager/api/odl.py b/src/palace/manager/api/odl.py index 407bc5da0a..413b62dfdb 100644 --- a/src/palace/manager/api/odl.py +++ b/src/palace/manager/api/odl.py @@ -341,7 +341,7 @@ def get_license_status_document(self, loan: Loan) -> dict[str, Any]: ) self.log.error( f"Error getting License Status Document for loan ({loan.id}): Url '{url}' returned " - f"status code {response.status_code}. Response headers: {header_string}. " + f"status code {response.status_code}. Expected 2XX. Response headers: {header_string}. " f"Response content: {response_string}." ) raise BadResponseException(url, "License Status Document request failed.") diff --git a/tests/manager/api/test_odl.py b/tests/manager/api/test_odl.py index 402c90a029..f2664c69f0 100644 --- a/tests/manager/api/test_odl.py +++ b/tests/manager/api/test_odl.py @@ -52,7 +52,7 @@ class TestODLAPI: def test_get_license_status_document_success( self, odl_api_test_fixture: ODLAPITestFixture ) -> None: - # With a new loan. + # With a new loan. New loan returns a 201 status. loan, _ = odl_api_test_fixture.license.loan_to(odl_api_test_fixture.patron) odl_api_test_fixture.api.queue_response( 201, content=json.dumps(dict(status="ready")) @@ -101,7 +101,7 @@ def test_get_license_status_document_success( == notification_url ) - # With an existing loan. + # With an existing loan. Existing loan returns a 200 status. loan, _ = odl_api_test_fixture.license.loan_to(odl_api_test_fixture.patron) loan.external_identifier = odl_api_test_fixture.db.fresh_str() @@ -139,7 +139,7 @@ def test_get_license_status_document_errors( odl_api_test_fixture.api.get_license_status_document, loan, ) - assert "returned status code 403." in caplog.text + assert "returned status code 403. Expected 2XX." in caplog.text assert "just junk ..." in caplog.text def test_checkin_success(