This commit is contained in:
Kenneth Kehl
2024-11-18 09:26:04 -08:00
parent 4ef1847baf
commit 3168f28920
5 changed files with 17 additions and 11 deletions

View File

@@ -1,8 +1,10 @@
import uuid
import pytest
from sqlalchemy import select
from sqlalchemy.exc import SQLAlchemyError
from app import db
from app.dao.service_email_reply_to_dao import (
add_reply_to_email_address_for_service,
archive_reply_to_email_address,
@@ -186,7 +188,7 @@ def test_update_reply_to_email_address(sample_service):
email_address="change_address@email.com",
is_default=True,
)
updated_reply_to = ServiceEmailReplyTo.query.get(first_reply_to.id)
updated_reply_to = db.session.get(ServiceEmailReplyTo, first_reply_to.id)
assert updated_reply_to.email_address == "change_address@email.com"
assert updated_reply_to.updated_at
@@ -206,7 +208,7 @@ def test_update_reply_to_email_address_set_updated_to_default(sample_service):
is_default=True,
)
results = ServiceEmailReplyTo.query.all()
results = db.session.execute(select(ServiceEmailReplyTo)).scalars().all()
assert len(results) == 2
for x in results:
if x.email_address == "change_address@email.com":

View File

@@ -23,7 +23,7 @@ def test_send_notification_to_service_users_persists_notifications_correctly(
service_id=sample_service.id, template_id=template.id
)
notification = Notification.query.one()
notification = db.session.execute(select(Notification)).scalars().one()
stmt = select(func.count()).select_from(Notification)
count = db.session.execute(stmt).scalar() or 0