This commit is contained in:
Kenneth Kehl
2024-11-15 13:42:27 -08:00
parent 3eadfb2242
commit bc4d4c9735
8 changed files with 70 additions and 51 deletions

View File

@@ -100,9 +100,9 @@ def test_persist_notification_creates_and_save_to_db(
reply_to_text=sample_template.service.get_default_sms_sender(),
)
assert Notification.query.get(notification.id) is not None
assert db.session.get(Notification, notification.id) is not None
notification_from_db = Notification.query.one()
notification_from_db = db.session.execute(select(Notification)).scalars().one()
assert notification_from_db.id == notification.id
assert notification_from_db.template_id == notification.template_id

View File

@@ -64,7 +64,7 @@ def test_receive_notification_returns_received_to_sns(
prom_counter_labels_mock.assert_called_once_with("sns")
prom_counter_labels_mock.return_value.inc.assert_called_once_with()
inbound_sms_id = InboundSms.query.all()[0].id
inbound_sms_id = db.session.execute(select(InboundSms)).scalars().all()[0].id
mocked.assert_called_once_with(
[str(inbound_sms_id), str(sample_service_full_permissions.id)],
queue="notify-internal-tasks",
@@ -136,7 +136,7 @@ def test_receive_notification_without_permissions_does_not_create_inbound_even_w
response = sns_post(client, data)
assert response.status_code == 200
assert len(InboundSms.query.all()) == 0
assert len(db.session.execute(select(InboundSms)).scalars().all()) == 0
assert mocked_has_permissions.called
mocked_send_inbound_sms.assert_not_called()