feature:Mail-Einladung
This commit is contained in:
1 parent
675a8cd6f2
commit
639f14fc2e
43 files changed
+3017
-486
No files matched your search
@@ -22,7 +22,7 @@ from test_mail import content, messages
|
||||
from test_phase5 import bookings, options_of, slot_form
|
||||
|
||||
from surveybox import db
|
||||
from surveybox.forms import digest, followups, reminders
|
||||
from surveybox.forms import digest, followups, invitations
|
||||
from surveybox.models import (
|
||||
Followup,
|
||||
FollowupDocument,
|
||||
@@ -179,7 +179,7 @@ def test_reminder_for_invited_people(app: Any) -> None:
|
||||
s.add(FormAccessEntry(form_id=form.id, user_id=users[email]))
|
||||
s.execute(update(Form).where(Form.id == form.id).values(
|
||||
access=FormAccess.RESTRICTED, closes_at=datetime.now(UTC) + timedelta(days=2),
|
||||
reminder_days=3))
|
||||
remind_first_at=datetime.now(UTC) - timedelta(minutes=1), invite_accounts=False))
|
||||
s.commit()
|
||||
olga = new_client(app)
|
||||
from helpers import login
|
||||
@@ -188,9 +188,9 @@ def test_reminder_for_invited_people(app: Any) -> None:
|
||||
assert fill(olga, token, {f"q{qid}": early}).status_code == 303
|
||||
settings = get_settings()
|
||||
with Session(db.get_engine()) as s:
|
||||
assert reminders.run_due(s, settings, datetime.now(UTC)) == 1
|
||||
assert invitations.run_due(s, settings, datetime.now(UTC)) == 1
|
||||
s.commit()
|
||||
assert reminders.run_due(s, settings, datetime.now(UTC)) == 0 # nur einmal
|
||||
assert invitations.run_due(s, settings, datetime.now(UTC)) == 0 # nur einmal
|
||||
s.commit()
|
||||
assert [m.recipient for m in messages("reminder")] == ["paul@example.de"]
|
||||
|
||||
|
||||
Reference in new issue
Block a user