Put API keys on service model

Similar to how we put templates on the service model, it means less
logic needs to happen in the view code.
This commit is contained in:
Chris Hill-Scott
2018-11-07 11:35:24 +00:00
parent 302078ac28
commit d1c9dcfb1d
4 changed files with 14 additions and 10 deletions

View File

@@ -186,7 +186,7 @@ def test_should_show_empty_api_keys_page(
assert response.status_code == 200
assert 'You havent created any API keys yet' in response.get_data(as_text=True)
assert 'Create an API key' in response.get_data(as_text=True)
mock_get_no_api_keys.assert_called_once_with(service_id=service_id)
mock_get_no_api_keys.assert_called_once_with(service_id)
def test_should_show_api_keys_page(
@@ -205,7 +205,7 @@ def test_should_show_api_keys_page(
assert 'some key name' in resp_data
assert 'another key name' in resp_data
assert 'Revoked 1 January at 1:00am' in resp_data
mock_get_api_keys.assert_called_once_with(service_id=fake_uuid)
mock_get_api_keys.assert_called_once_with(fake_uuid)
@pytest.mark.parametrize('service_mock, expected_options', [
@@ -323,7 +323,7 @@ def test_should_show_confirm_revoke_api_key(
service_id='596364a0-858e-42c8-9062-a8fe822260eb',
),
call(
service_id='596364a0-858e-42c8-9062-a8fe822260eb'
'596364a0-858e-42c8-9062-a8fe822260eb'
),
]