-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix broken go live email notification
- Loading branch information
Kenneth Kehl
committed
Nov 27, 2024
1 parent
9b392af
commit 6c0cbd2
Showing
2 changed files
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import pytest | ||
from flask import current_app | ||
from app.utils import hilite | ||
from sqlalchemy import func, select | ||
|
||
from app import db | ||
from app.dao.services_dao import dao_add_user_to_service | ||
from app.dao.services_dao import dao_add_user_to_service, dao_fetch_active_users_for_service | ||
from app.enums import NotificationType, TemplateType | ||
from app.models import Notification | ||
from app.service.sender import send_notification_to_service_users | ||
|
@@ -91,8 +92,15 @@ def test_send_notification_to_service_users_sends_to_active_users_only( | |
second_active_user = create_user(email="[email protected]", state="active") | ||
pending_user = create_user(email="[email protected]", state="pending") | ||
service = create_service(user=first_active_user) | ||
print(hilite(f"CREATED THE SERVICE {service} with user {first_active_user}")) | ||
dao_add_user_to_service(service, second_active_user) | ||
print(hilite(f"ADDED user {second_active_user}")) | ||
|
||
dao_add_user_to_service(service, pending_user) | ||
print(hilite(f"ADDED PENDING USER {pending_user}")) | ||
|
||
active_users = dao_fetch_active_users_for_service(service.id) | ||
print(hilite(f"ACTIVE USERS IN THE TEST {active_users}")) | ||
template = create_template(service, template_type=TemplateType.EMAIL) | ||
|
||
send_notification_to_service_users(service_id=service.id, template_id=template.id) | ||
|