mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Collect organisation type
So that we can default services to their appropriate text allowance, we need to find out what sector they're in. So let's start collecting that from teams as they create new services. I think Central/Local/NHS are the right options, but these can be easily changed if not.
This commit is contained in:
@@ -43,3 +43,38 @@ def test_client_only_updates_allowed_attributes(mocker):
|
||||
with pytest.raises(TypeError) as error:
|
||||
ServiceAPIClient().update_service('service_id', foo='bar')
|
||||
assert str(error.value) == 'Not allowed to update service attributes: foo'
|
||||
|
||||
|
||||
def test_client_creates_service_with_correct_data(
|
||||
mocker,
|
||||
active_user_with_permissions,
|
||||
fake_uuid,
|
||||
):
|
||||
client = ServiceAPIClient()
|
||||
mock_post = mocker.patch.object(client, 'post')
|
||||
mocker.patch('app.notify_client.current_user', id='123')
|
||||
|
||||
client.create_service(
|
||||
service_name='My first service',
|
||||
organisation_type='central_government',
|
||||
message_limit=1,
|
||||
restricted=True,
|
||||
user_id=fake_uuid,
|
||||
email_from='test@example.com',
|
||||
)
|
||||
mock_post.assert_called_once_with(
|
||||
'/service',
|
||||
dict(
|
||||
# Autogenerated arguments
|
||||
created_by='123',
|
||||
active=True,
|
||||
# ‘service_name’ argument is coerced to ‘name’
|
||||
name='My first service',
|
||||
# The rest pass through with the same names
|
||||
organisation_type='central_government',
|
||||
message_limit=1,
|
||||
restricted=True,
|
||||
user_id=fake_uuid,
|
||||
email_from='test@example.com',
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user