fix tests

This commit is contained in:
Kenneth Kehl
2024-01-24 07:55:14 -08:00
parent c97be34b3b
commit b5a0562077
6 changed files with 94 additions and 16 deletions

View File

@@ -1,9 +1,11 @@
import json
from datetime import datetime
from flask import Blueprint, current_app, jsonify, request
from itsdangerous import BadData, SignatureExpired
from notifications_utils.url_safe_token import check_token, generate_token
from app import redis_store
from app.config import QueueNames
from app.dao.invited_user_dao import (
get_expired_invite_by_service_and_id,
@@ -38,6 +40,7 @@ def _create_service_invite(invited_user, invite_link_host):
"service_name": invited_user.service.name,
"url": invited_user_url(invited_user.id, invite_link_host),
}
saved_notification = persist_notification(
template_id=template.id,
template_version=template.version,
@@ -50,6 +53,11 @@ def _create_service_invite(invited_user, invite_link_host):
reply_to_text=invited_user.from_user.email_address,
)
saved_notification.personalisation = personalisation
redis_store.set(
f"email-personalisation-{saved_notification.id}",
json.dumps(personalisation),
ex=1800,
)
send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY)