mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
Update email_from when the service name is changed.
Update unit tests Service name is uniqueness is not based on case.
This commit is contained in:
@@ -77,14 +77,15 @@ def mock_update_service(mocker):
|
||||
active,
|
||||
limit,
|
||||
restricted,
|
||||
users):
|
||||
users,
|
||||
email_from):
|
||||
service = service_json(
|
||||
service_id, service_name, users, limit=limit,
|
||||
active=active, restricted=restricted)
|
||||
active=active, restricted=restricted, email_from=email_from)
|
||||
return {'data': service}
|
||||
|
||||
return mocker.patch(
|
||||
'app.service_api_client.update_service', side_effect=_update)
|
||||
'app.service_api_client.update_service', side_effect=_update, autospec=True)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
@@ -94,7 +95,8 @@ def mock_update_service_raise_httperror_duplicate_name(mocker):
|
||||
active,
|
||||
limit,
|
||||
restricted,
|
||||
users):
|
||||
users,
|
||||
email_from):
|
||||
json_mock = Mock(return_value={'message': {'name': ["Duplicate service name '{}'".format(service_name)]}})
|
||||
resp_mock = Mock(status_code=400, json=json_mock)
|
||||
http_error = HTTPError(response=resp_mock, message="Default message")
|
||||
|
||||
Reference in New Issue
Block a user