feat(rss): remove article content character cap
Trafilatura extracts only article body text (typically 2K–15K chars), so storing the full content is safe without an artificial ceiling. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,14 +16,16 @@ def test_extract_item_fields():
|
||||
assert item["content"] == "A summary"
|
||||
|
||||
|
||||
def test_extract_item_truncates_content():
|
||||
"""extract_item() should truncate content to CONTENT_MAX_CHARS."""
|
||||
from fabledassistant.services.rss import extract_item, CONTENT_MAX_CHARS
|
||||
def test_extract_item_does_not_truncate_content():
|
||||
"""extract_item() should store content without truncation."""
|
||||
from fabledassistant.services.rss import extract_item
|
||||
long_text = "x" * 100_000
|
||||
entry = MagicMock()
|
||||
entry.get = lambda k, d="": {"summary": "x" * (CONTENT_MAX_CHARS + 1000), "title": "", "link": "", "id": "g"}.get(k, d)
|
||||
entry.get = lambda k, d="": {"summary": long_text, "title": "", "link": "", "id": "g"}.get(k, d)
|
||||
entry.content = []
|
||||
entry.published_parsed = None
|
||||
item = extract_item(entry)
|
||||
assert len(item["content"]) == CONTENT_MAX_CHARS
|
||||
assert len(item["content"]) == 100_000
|
||||
|
||||
|
||||
def test_extract_item_prefers_content_over_summary():
|
||||
|
||||
Reference in New Issue
Block a user