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: remove unimplemented /news/insights and /news/preferences routes (#2270)

LearningCircuitefb7a0cbe189
diff --git a/src/local_deep_research/news/web.py b/src/local_deep_research/news/web.py
index 06074b6e8b..09eeb70eaf 100644
--- a/src/local_deep_research/news/web.py
+++ b/src/local_deep_research/news/web.py
@@ -44,16 +44,6 @@ def create_news_blueprint():
default_strategy=default_strategy,
)
- @bp.route("/insights")
- def insights_page():
- """Render the news insights/transparency page."""
- return render_template("pages/news_insights.html")
-
- @bp.route("/preferences")
- def preferences_page():
- """Render the user preferences page."""
- return render_template("pages/news_preferences.html")
-
@bp.route("/subscriptions")
def subscriptions_page():
"""Render the subscriptions management page."""
diff --git a/tests/news/test_web_blueprint.py b/tests/news/test_web_blueprint.py
index 13cc7c0911..7ea7fc1263 100644
--- a/tests/news/test_web_blueprint.py
+++ b/tests/news/test_web_blueprint.py
@@ -3,7 +3,7 @@ Tests for news/web.py - Flask blueprint for news system web routes.
Tests cover:
- create_news_blueprint: Blueprint creation and route registration
-- Page routes: news, insights, preferences, subscriptions
+- Page routes: news, subscriptions
- new_subscription_page: Form rendering with default settings
- edit_subscription_page: Subscription loading and error handling
- health_check: Database connectivity checks
@@ -64,8 +64,6 @@ class TestCreateNewsBlueprint:
"""Test that all expected routes are registered."""
expected_routes = [
"/news/",
- "/news/insights",
- "/news/preferences",
"/news/subscriptions",
"/news/subscriptions/new",
"/news/subscriptions/<subscription_id>/edit",
@@ -135,58 +133,6 @@ class TestNewsPageRoute:
assert kwargs["default_strategy"] == "topic_based"
-class TestInsightsPageRoute:
- """Tests for insights_page route."""
-
- def test_insights_page_returns_200(self, client):
- """Test that insights page returns 200 status."""
- with patch(
- "local_deep_research.news.web.render_template"
- ) as mock_render:
- mock_render.return_value = "rendered"
-
- response = client.get("/news/insights")
-
- assert response.status_code == 200
-
- def test_insights_page_renders_correct_template(self, client):
- """Test that correct template is rendered."""
- with patch(
- "local_deep_research.news.web.render_template"
- ) as mock_render:
- mock_render.return_value = "rendered"
-
- client.get("/news/insights")
-
- mock_render.assert_called_once_with("pages/news_insights.html")
-
-
-class TestPreferencesPageRoute:
- """Tests for preferences_page route."""
-
- def test_preferences_page_returns_200(self, client):
- """Test that preferences page returns 200 status."""
- with patch(
- "local_deep_research.news.web.render_template"
- ) as mock_render:
- mock_render.return_value = "rendered"
-
- response = client.get("/news/preferences")
-
- assert response.status_code == 200
-
- def test_preferences_page_renders_correct_template(self, client):
- """Test that correct template is rendered."""
- with patch(
- "local_deep_research.news.web.render_template"
- ) as mock_render:
- mock_render.return_value = "rendered"
-
- client.get("/news/preferences")
-
- mock_render.assert_called_once_with("pages/news_preferences.html")
-
-
class TestSubscriptionsPageRoute:
"""Tests for subscriptions_page route."""
diff --git a/tests/news/test_web_blueprint_logic_behavior.py b/tests/news/test_web_blueprint_logic_behavior.py
index d95b8f71d5..055c379f15 100644
--- a/tests/news/test_web_blueprint_logic_behavior.py
+++ b/tests/news/test_web_blueprint_logic_behavior.py
@@ -349,8 +349,6 @@ class TestBlueprintRoutes:
def _get_expected_routes(self):
return [
"/",
- "/insights",
- "/preferences",
"/subscriptions",
"/subscriptions/new",
"/subscriptions/<subscription_id>/edit",
@@ -360,12 +358,6 @@ class TestBlueprintRoutes:
def test_has_main_route(self):
assert "/" in self._get_expected_routes()
- def test_has_insights_route(self):
- assert "/insights" in self._get_expected_routes()
-
- def test_has_preferences_route(self):
- assert "/preferences" in self._get_expected_routes()
-
def test_has_subscriptions_route(self):
assert "/subscriptions" in self._get_expected_routes()
@@ -388,8 +380,6 @@ class TestTemplateNames:
TEMPLATES = {
"main": "pages/news.html",
- "insights": "pages/news_insights.html",
- "preferences": "pages/news_preferences.html",
"subscriptions": "pages/subscriptions.html",
"subscription_form": "pages/news-subscription-form.html",
}
@@ -397,12 +387,6 @@ class TestTemplateNames:
def test_main_template(self):
assert self.TEMPLATES["main"] == "pages/news.html"
- def test_insights_template(self):
- assert self.TEMPLATES["insights"] == "pages/news_insights.html"
-
- def test_preferences_template(self):
- assert self.TEMPLATES["preferences"] == "pages/news_preferences.html"
-
def test_subscriptions_template(self):
assert self.TEMPLATES["subscriptions"] == "pages/subscriptions.html"
diff --git a/tests/news/test_web_routes_comprehensive.py b/tests/news/test_web_routes_comprehensive.py
index 354afd4b72..aaaf22a60f 100644
--- a/tests/news/test_web_routes_comprehensive.py
+++ b/tests/news/test_web_routes_comprehensive.py
@@ -92,50 +92,6 @@ class TestNewsPageRoute:
assert "news_aggregation" in strategies
-class TestInsightsPageRoute:
- """Tests for the insights page route."""
-
- @patch("local_deep_research.news.web.render_template")
- def test_insights_page_renders_template(self, mock_render):
- """Test insights_page renders correct template."""
- from local_deep_research.news.web import create_news_blueprint
- from flask import Flask
-
- mock_render.return_value = "rendered"
-
- app = Flask(__name__)
- bp = create_news_blueprint()
- app.register_blueprint(bp, url_prefix="/news")
-
- with app.test_client() as client:
- client.get("/news/insights")
- mock_render.assert_called()
- call_args = mock_render.call_args
- assert "news_insights.html" in str(call_args)
-
-
-class TestPreferencesPageRoute:
- """Tests for the preferences page route."""
-
- @patch("local_deep_research.news.web.render_template")
- def test_preferences_page_renders_template(self, mock_render):
- """Test preferences_page renders correct template."""
- from local_deep_research.news.web import create_news_blueprint
- from flask import Flask
-
- mock_render.return_value = "rendered"
-
- app = Flask(__name__)
- bp = create_news_blueprint()
- app.register_blueprint(bp, url_prefix="/news")
-
- with app.test_client() as client:
- client.get("/news/preferences")
- mock_render.assert_called()
- call_args = mock_render.call_args
- assert "news_preferences.html" in str(call_args)
-
-
class TestSubscriptionsPageRoute:
"""Tests for the subscriptions page route."""
diff --git a/tests/ui_tests/playwright/tests/mobile-components.spec.js b/tests/ui_tests/playwright/tests/mobile-components.spec.js
index de16917611..a55562be10 100644
--- a/tests/ui_tests/playwright/tests/mobile-components.spec.js
+++ b/tests/ui_tests/playwright/tests/mobile-components.spec.js
@@ -1665,44 +1665,6 @@ test.describe('Download Manager Page', () => {
// ============================================
test.describe('News Sub-Pages', () => {
- test('News insights page', async ({ page, isMobile }) => {
- if (!isMobile) {
- test.skip();
- return;
- }
-
- await page.goto('/news/insights');
- await page.waitForLoadState('domcontentloaded');
- await ensureSheetsClosed(page);
-
- const pageContent = page.locator('main, .ldr-page, .ldr-insights');
- if (await pageContent.first().isVisible()) {
- await expect(page).toHaveScreenshot('news-insights-page.png', {
- fullPage: false,
- maxDiffPixelRatio: 0.02,
- });
- }
- });
-
- test('News preferences page', async ({ page, isMobile }) => {
- if (!isMobile) {
- test.skip();
- return;
- }
-
- await page.goto('/news/preferences');
- await page.waitForLoadState('domcontentloaded');
- await ensureSheetsClosed(page);
-
- const pageContent = page.locator('main, .ldr-page, .ldr-preferences');
- if (await pageContent.first().isVisible()) {
- await expect(page).toHaveScreenshot('news-preferences-page.png', {
- fullPage: false,
- maxDiffPixelRatio: 0.02,
- });
- }
- });
-
test('News subscriptions list page', async ({ page, isMobile }) => {
if (!isMobile) {
test.skip();
diff --git a/tests/ui_tests/playwright/tests/untested-subpages.spec.js b/tests/ui_tests/playwright/tests/untested-subpages.spec.js
index 0f68ec28bb..c9258a3f46 100644
--- a/tests/ui_tests/playwright/tests/untested-subpages.spec.js
+++ b/tests/ui_tests/playwright/tests/untested-subpages.spec.js
@@ -2,10 +2,8 @@
* Untested Subpages Tests
*
* Tests for pages that have zero test coverage:
- * 1. /news/insights - Known broken route (missing template)
- * 2. /news/preferences - Known broken route (missing template)
- * 3. /benchmark/results - Benchmark results page
- * 4. /auth/change-password - Change password form
+ * 1. /benchmark/results - Benchmark results page
+ * 2. /auth/change-password - Change password form
*
* Covers mobile + desktop: page load, overflow, touch targets, screenshots.
*
@@ -20,58 +18,6 @@ const {
waitForPageLoad,
} = require('./helpers/mobile-utils');
-// ============================================
-// BROKEN ROUTES - Document Real Bugs
-// ============================================
-
-test.describe('Broken Routes - News Subpages', () => {
- test('/news/insights returns error (missing template)', async ({ page }) => {
- const response = await page.goto('/news/insights');
-
- // This route should 500 because the template doesn't exist
- // If it returns 200, the bug may have been fixed
- const status = response?.status();
- if (status === 500 || status === 404) {
- // Document the bug: route is broken
- console.log(`/news/insights returned ${status} - missing template confirmed`);
- expect([404, 500]).toContain(status);
- } else if (status === 200) {
- // Bug has been fixed - verify the page loads properly
- console.log('/news/insights returned 200 - template exists now');
- await page.waitForLoadState('domcontentloaded');
-
- // If it loads, check for page errors
- const pageErrors = [];
- page.on('pageerror', (error) => pageErrors.push(error.message));
- expect(pageErrors.length).toBe(0);
- } else {
- // Unexpected status code - may be a redirect
- console.log(`/news/insights returned unexpected status: ${status}`);
- expect(status).toBeLessThan(500);
- }
- });
-
- test('/news/preferences returns error (missing template)', async ({ page }) => {
- const response = await page.goto('/news/preferences');
-
- const status = response?.status();
- if (status === 500 || status === 404) {
- console.log(`/news/preferences returned ${status} - missing template confirmed`);
- expect([404, 500]).toContain(status);
- } else if (status === 200) {
- console.log('/news/preferences returned 200 - template exists now');
- await page.waitForLoadState('domcontentloaded');
-
- const pageErrors = [];
- page.on('pageerror', (error) => pageErrors.push(error.message));
- expect(pageErrors.length).toBe(0);
- } else {
- console.log(`/news/preferences returned unexpected status: ${status}`);
- expect(status).toBeLessThan(500);
- }
- });
-});
-
// ============================================
// BENCHMARK RESULTS PAGE
// ============================================