fix(test): patch ApiDependencies in auth_dependencies to fix recall tests

The patched_dependencies fixture only monkeypatched ApiDependencies in
the recall_parameters module, but the endpoint also resolves
CurrentUserOrDefault via auth_dependencies, which accesses
ApiDependencies.invoker independently. Patch both import sites.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lincoln Stein
2026-04-13 19:36:47 -04:00
parent bc9dfb1428
commit 6108ca54c4

View File

@@ -47,6 +47,7 @@ def patched_dependencies(monkeypatch: Any, mock_invoker: Invoker) -> MockApiDepe
"""
dependencies = MockApiDependencies(mock_invoker)
monkeypatch.setattr("invokeai.app.api.routers.recall_parameters.ApiDependencies", dependencies)
monkeypatch.setattr("invokeai.app.api.auth_dependencies.ApiDependencies", dependencies)
monkeypatch.setattr(
mock_invoker.services.client_state_persistence,
"set_by_key",