feat: use message-id header to only process message once

This commit is contained in:
Leon
2025-07-16 18:38:06 +02:00
parent d47e975574
commit 9512601124
8 changed files with 120 additions and 14 deletions

View File

@@ -1,3 +1,5 @@
import uuid
from sqlalchemy.orm import Session
from app.crud.entries import create_entry
@@ -17,12 +19,16 @@ def test_generate_feed(db_session: Session):
# Create entries for the newsletter
entry1_data = EntryCreate(
subject="First Entry", body="<p>This is the first entry.</p>"
subject="First Entry",
body="<p>This is the first entry.</p>",
message_id=f"<{uuid.uuid4()}@test.com>",
)
create_entry(db_session, entry1_data, newsletter.id)
entry2_data = EntryCreate(
subject="Second Entry", body="<p>This is the second entry.</p>"
subject="Second Entry",
body="<p>This is the second entry.</p>",
message_id=f"<{uuid.uuid4()}@test.com>",
)
create_entry(db_session, entry2_data, newsletter.id)