mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
more
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user