Fehler in der API behoben

This commit is contained in:
2025-08-02 18:37:17 +02:00
parent 45cc02b4b0
commit e4b37d9261
2 changed files with 12 additions and 6 deletions

View File

@@ -221,10 +221,11 @@ def test_api_plusminus(client):
def test_api_stats(client):
resp = client.get('/api/stats')
assert resp.status_code == 200
# Die Route gibt HTML zurück, nicht JSON
html = resp.data.decode('utf-8')
# Prüfe auf typische HTML-Elemente des Dashboards
assert 'Statistik-Dashboard' in html or 'Dashboard' in html
data = resp.get_json()
assert "pageviews" in data
assert "func_counts" in data
assert "impressions_per_day" in data
assert "api_counts" in data
def test_api_monitor(client):
resp = client.get('/api/monitor')