Skip to content

Commit

Permalink
Fixed test for disabled cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
jompu committed Mar 14, 2024
1 parent da863e3 commit 9091e8f
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/api/controller/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,17 @@ def test_authentication_document(
assert library_name == doc["title"]

# Verify that the authentication document cache is working.
circulation_fixture.manager.authentication_for_opds_documents[
library_name
] = "Cached value"
with circulation_fixture.request_context_with_library(
"/", headers=dict(Authorization=circulation_fixture.invalid_auth)
):
response = (
circulation_fixture.manager.index_controller.authentication_document()
)
assert response.get_data(as_text=True) == "Cached value"
# Finland: cache is "hard" disabled. Check CirculationManager::load_settings for more info.
# circulation_fixture.manager.authentication_for_opds_documents[
# library_name
# ] = "Cached value"
# with circulation_fixture.request_context_with_library(
# "/", headers=dict(Authorization=circulation_fixture.invalid_auth)
# ):
# response = (
# circulation_fixture.manager.index_controller.authentication_document()
# )
# assert response.get_data(as_text=True) == "Cached value"

# Verify what happens when the cache is disabled.
circulation_fixture.manager.authentication_for_opds_documents.max_age = 0
Expand Down

0 comments on commit 9091e8f

Please sign in to comment.