Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix(tests): align two failing tests with current production behavior (#3695)

LearningCircuitb97c0467305c
diff --git a/tests/mcp/test_mcp_strategy.py b/tests/mcp/test_mcp_strategy.py
index 23616af20d..4e937981f4 100644
--- a/tests/mcp/test_mcp_strategy.py
+++ b/tests/mcp/test_mcp_strategy.py
@@ -439,9 +439,19 @@ ANSWER: Quantum computing uses qubits."""
}
]
+ # Mock the citation handler so it preserves the ReAct answer instead
+ # of re-invoking the model (which would consume from side_effect and
+ # return unrelated content).
+ mock_citation_handler = MagicMock()
+ mock_citation_handler.analyze_followup.return_value = {
+ "content": "Quantum computing uses qubits.",
+ "documents": [],
+ }
+
strategy = MCPSearchStrategy(
model=mock_model,
search=mock_search,
+ citation_handler=mock_citation_handler,
)
result = strategy.analyze_topic("What is quantum computing?")
diff --git a/tests/web/routes/test_history_routes_extended.py b/tests/web/routes/test_history_routes_extended.py
index 0622efc70e..e129d02eac 100644
--- a/tests/web/routes/test_history_routes_extended.py
+++ b/tests/web/routes/test_history_routes_extended.py
@@ -74,11 +74,13 @@ def _build_query_chain(results):
class TestGetHistoryAuth:
"""Authentication tests for the /history/api endpoint."""
- def test_redirects_when_not_authenticated(self, client):
- """An unauthenticated request should be redirected to login."""
+ def test_returns_401_when_not_authenticated(self, client):
+ """An unauthenticated request to an API path returns JSON 401."""
response = client.get("/history/api")
- # login_required redirects non-API routes to the login page
- assert response.status_code == 302
+ # /history/api ends in /api, so login_required treats it as an API
+ # route and returns JSON 401 instead of redirecting.
+ assert response.status_code == 401
+ assert response.get_json() == {"error": "Authentication required"}
def test_returns_success_with_items_when_authenticated(self, app):
"""Authenticated request returns JSON with status=success and items."""