mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Need to remove priority logic
This commit is contained in:
@@ -1113,49 +1113,6 @@ def test_create_template_raises_invalid_request_when_content_too_large(
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"notification_type,send_to",
|
||||
[
|
||||
(NotificationType.SMS, "2028675309"),
|
||||
(
|
||||
NotificationType.EMAIL,
|
||||
"sample@email.com",
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_send_notification_uses_priority_queue_when_template_is_marked_as_priority(
|
||||
client,
|
||||
sample_service,
|
||||
mocker,
|
||||
notification_type,
|
||||
send_to,
|
||||
):
|
||||
sample = create_template(
|
||||
sample_service,
|
||||
template_type=notification_type,
|
||||
process_type=TemplateProcessType.PRIORITY,
|
||||
)
|
||||
mocked = mocker.patch(
|
||||
f"app.celery.provider_tasks.deliver_{notification_type}.apply_async"
|
||||
)
|
||||
|
||||
data = {"to": send_to, "template": str(sample.id)}
|
||||
|
||||
auth_header = create_service_authorization_header(service_id=sample.service_id)
|
||||
|
||||
response = client.post(
|
||||
path=f"/notifications/{notification_type}",
|
||||
data=json.dumps(data),
|
||||
headers=[("Content-Type", "application/json"), auth_header],
|
||||
)
|
||||
|
||||
response_data = json.loads(response.data)["data"]
|
||||
notification_id = response_data["notification"]["id"]
|
||||
|
||||
assert response.status_code == 201
|
||||
mocked.assert_called_once_with([notification_id], queue="priority-tasks")
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"notification_type, send_to",
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user