mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
add send_notification file for handling sending one off messages
currently, they're made by creating a one-line job, but we want to reduce task/csv file noise so we're moving them to persist in the same vein as API usage. However, we can't just call through to that since there are some differences: * no api keys * tighter control over API format * no scheduling * no client references etc. So, re-using as much of the v2 validation stuff as possible, I've created this file that just does basic validation, and then calls through to persist_notification and schedules a task. Woo.
This commit is contained in:
@@ -12,13 +12,14 @@ from app import encryption
|
||||
from app.dao.users_dao import save_model_user
|
||||
from app.dao.services_dao import dao_remove_user_from_service
|
||||
from app.models import (
|
||||
Organisation, Rate, Service, ServicePermission, User,
|
||||
User, Organisation, Rate, Service, ServicePermission,
|
||||
DVLA_ORG_LAND_REGISTRY,
|
||||
KEY_TYPE_NORMAL, KEY_TYPE_TEAM, KEY_TYPE_TEST,
|
||||
EMAIL_TYPE, SMS_TYPE, LETTER_TYPE, INTERNATIONAL_SMS_TYPE, INBOUND_SMS_TYPE,
|
||||
DVLA_ORG_LAND_REGISTRY
|
||||
)
|
||||
|
||||
from tests import create_authorization_header
|
||||
from tests.app.db import create_template, create_service_inbound_api
|
||||
from tests.app.db import create_template, create_service_inbound_api, create_user
|
||||
from tests.app.conftest import (
|
||||
sample_service as create_service,
|
||||
sample_user_service_permission as create_user_service_permission,
|
||||
@@ -27,8 +28,6 @@ from tests.app.conftest import (
|
||||
sample_notification_with_job
|
||||
)
|
||||
|
||||
from tests.app.db import create_user
|
||||
|
||||
|
||||
def test_get_service_list(client, service_factory):
|
||||
service_factory.get('one')
|
||||
|
||||
Reference in New Issue
Block a user