Fix get started banner on dashboard

This banner was always being shown because the template was never
getting sent the service’s templates from the API.

This commit fixes this to only show the banner when a service has no
templates, and adds some tests to make sure it doesn’t happen again.
This commit is contained in:
Chris Hill-Scott
2016-07-04 13:04:25 +01:00
parent eb32393551
commit cddfd6c517
4 changed files with 69 additions and 1 deletions

View File

@@ -424,6 +424,17 @@ def mock_get_service_templates(mocker):
side_effect=_create)
@pytest.fixture(scope='function')
def mock_get_service_templates_when_no_templates_exist(mocker):
def _create(service_id):
return {'data': []}
return mocker.patch(
'app.service_api_client.get_service_templates',
side_effect=_create)
@pytest.fixture(scope='function')
def mock_delete_service_template(mocker):
def _delete(service_id, template_id):