Skip to content

Commit

Permalink
Disable dogpile cache when running client API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martinburchell committed Jan 29, 2025
1 parent b2ba7c8 commit 51eb754
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/camcops_server/cc_modules/tests/client_api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
from sqlalchemy import select

from camcops_server.cc_modules.cc_all_models import CLIENT_TABLE_MAP
from camcops_server.cc_modules.cc_cache import cache_region_static
from camcops_server.cc_modules.cc_client_api_core import (
AllowedTablesFieldNames,
fail_server_error,
Expand Down Expand Up @@ -236,6 +237,10 @@ def setUp(self) -> None:
),
TabletParam.DEVICE: self.device.name,
}
# To prevent test failures when mocking cached functions
cache_region_static.configure(
backend="dogpile.cache.null", replace_existing_backend=True
)

def call_api(self) -> Dict[str, str]:
self.req.fake_request_post_from_dict(self.post_dict)
Expand Down

0 comments on commit 51eb754

Please sign in to comment.