mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Use service model to look up service attributes
This is better than just keying into the JSON because it means you get an exception straight away when looking up a key that doesn’t exist (which via mocking you could ordinarily miss).
This commit is contained in:
@@ -49,7 +49,7 @@ def test_from_database_object_makes_request(
|
||||
):
|
||||
resp = Mock(content='a', status_code='b', headers={'c': 'd'})
|
||||
request_mock = mocker.patch('app.template_previews.requests.post', return_value=resp)
|
||||
mocker.patch('app.template_previews.current_service', __getitem__=Mock(return_value='123'))
|
||||
mocker.patch('app.template_previews.current_service', dvla_organisation='123')
|
||||
template = mock_get_service_letter_template('123', '456')['data']
|
||||
|
||||
ret = partial_call(template=template)
|
||||
|
||||
Reference in New Issue
Block a user