mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-23 15:56:45 -04:00
Remove the upload letters permission
As of https://github.com/alphagov/notifications-admin/pull/3690 it’s no longer referred to.
This commit is contained in:
@@ -34,8 +34,6 @@ from app.models import (
|
||||
INTERNATIONAL_SMS_TYPE,
|
||||
INBOUND_SMS_TYPE,
|
||||
NOTIFICATION_RETURNED_LETTER,
|
||||
UPLOAD_LETTERS,
|
||||
|
||||
)
|
||||
from tests import create_authorization_header
|
||||
from tests.app.db import (
|
||||
@@ -289,7 +287,7 @@ def test_get_service_list_has_default_permissions(admin_request, service_factory
|
||||
set(
|
||||
json['permissions']
|
||||
) == {
|
||||
EMAIL_TYPE, SMS_TYPE, INTERNATIONAL_SMS_TYPE, LETTER_TYPE, UPLOAD_LETTERS, INTERNATIONAL_LETTERS
|
||||
EMAIL_TYPE, SMS_TYPE, INTERNATIONAL_SMS_TYPE, LETTER_TYPE, INTERNATIONAL_LETTERS
|
||||
}
|
||||
for json in json_resp['data']
|
||||
)
|
||||
@@ -301,7 +299,7 @@ def test_get_service_by_id_has_default_service_permissions(admin_request, sample
|
||||
assert set(
|
||||
json_resp['data']['permissions']
|
||||
) == {
|
||||
EMAIL_TYPE, SMS_TYPE, INTERNATIONAL_SMS_TYPE, LETTER_TYPE, UPLOAD_LETTERS, INTERNATIONAL_LETTERS
|
||||
EMAIL_TYPE, SMS_TYPE, INTERNATIONAL_SMS_TYPE, LETTER_TYPE, INTERNATIONAL_LETTERS
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,23 +4,18 @@ import pytest
|
||||
from freezegun import freeze_time
|
||||
|
||||
from app.dao.notifications_dao import get_notification_by_id
|
||||
from app.models import EMAIL_TYPE, LETTER_TYPE, UPLOAD_LETTERS
|
||||
from app.models import EMAIL_TYPE, LETTER_TYPE
|
||||
from app.service.send_notification import send_pdf_letter_notification
|
||||
from app.v2.errors import BadRequestError, TooManyRequestsError
|
||||
from notifications_utils.s3 import S3ObjectNotFound
|
||||
from tests.app.db import create_service
|
||||
|
||||
|
||||
@pytest.mark.parametrize('permissions', [
|
||||
[EMAIL_TYPE],
|
||||
[UPLOAD_LETTERS],
|
||||
])
|
||||
def test_send_pdf_letter_notification_raises_error_if_service_does_not_have_permission(
|
||||
notify_db_session,
|
||||
fake_uuid,
|
||||
permissions,
|
||||
):
|
||||
service = create_service(service_permissions=permissions)
|
||||
service = create_service(service_permissions=[EMAIL_TYPE])
|
||||
post_data = {'filename': 'valid.pdf', 'created_by': fake_uuid, 'file_id': fake_uuid, 'postage': 'first',
|
||||
'recipient_address': 'Bugs%20Bunny%0A123%20Main%20Street%0ALooney%20Town'}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user