Files
breakpilot-compliance/consent-tester/tests/test_cookieless_optout.py
T
Benjamin Admin d8a9e3049d feat(consent-tester): cookieless Opt-out erkennen statt False-HIGHs
Cookie-freie Analyse mit reinem Opt-out-Hinweis (z.B. bayshore.ai:
"Privacy-friendly, cookie-free analytics are currently enabled ... Disable")
ist KEIN Consent-Banner: cookieless = kein Endgeräte-Zugriff → §25 TDDDG
verlangt keine Einwilligung → Opt-out statt Opt-in. Die Standard-Opt-in-
Checks (granulare Kategorien, Accept/Reject-Balance, Impressum-im-Banner)
trafen nicht zu und erzeugten 3 Falsch-HIGHs.

is_cookieless_optout() erkennt das Muster (cookieless-Signal + Opt-out-Wort,
KEIN Consent-Signal); check_banner_text gibt dann früh EINEN ausführlichen
LOW-Erklär-Befund zurück (zählt nicht als HIGH) und setzt die Opt-in-Checks
aus. Ausführlich, weil der Fall extrem untypisch ist.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-12 19:27:12 +02:00

35 lines
1.2 KiB
Python

"""Cookieless Opt-out-Erkennung im banner_text_checker.
Sehr untypischer Sonderfall: cookie-FREIE Analyse mit reinem Opt-out-Hinweis
statt Consent-Banner (z.B. bayshore.ai). Standard-Opt-in-Checks duerfen dann
NICHT feuern (sonst False Positives).
"""
from services.banner_text_checker import is_cookieless_optout
def test_bayshore_cookieless_optout_detected():
# Realer bayshore.ai-Bannertext (Opt-out fuer cookie-freie Analyse).
bay = ("privacy-friendly, cookie-free analytics are currently enabled. "
"you can change your choice at any time. disable")
assert is_cookieless_optout(bay) is True
def test_standard_consent_banner_not_cookieless():
assert not is_cookieless_optout(
"wir nutzen cookies. alle akzeptieren ablehnen einstellungen")
def test_cookiefree_but_with_accept_is_not_optout():
# 'cookie-free' genannt, aber echtes Consent ('accept all') → kein reiner Opt-out.
assert not is_cookieless_optout("cookie-free analytics. accept all disable")
def test_signal_without_optout_word_is_not_detected():
# cookie-free, aber kein Opt-out-Mechanismus im Text.
assert not is_cookieless_optout("cookie-free analytics enabled")
def test_empty():
assert not is_cookieless_optout("")