Link to all services from organisation

Because a member of the organisation can now see some pages for any live
service they should be able to click into each one.
This commit is contained in:
Chris Hill-Scott
2019-06-20 10:35:55 +01:00
parent 3968d5b766
commit afedf431e0
4 changed files with 8 additions and 17 deletions

View File

@@ -9,6 +9,7 @@ from tests import organisation_json, service_json
from tests.conftest import (
ORGANISATION_ID,
SERVICE_ONE_ID,
SERVICE_TWO_ID,
active_user_with_permissions,
normalize_spaces,
platform_admin_user,
@@ -104,11 +105,11 @@ def test_organisation_services_shows_live_services_only(
mocker.patch(
'app.organisations_client.get_organisation_services',
return_value=[
service_json(id_='1', name='1', restricted=False, active=True), # live
service_json(id_=SERVICE_ONE_ID, name='1', restricted=False, active=True), # live
service_json(id_='2', name='2', restricted=True, active=True), # trial
service_json(id_='3', name='3', restricted=True, active=False), # trial, now archived
service_json(id_='4', name='4', restricted=False, active=False), # was live, now archived
service_json(id_=SERVICE_ONE_ID, name='5', restricted=False, active=True), # live, member of
service_json(id_=SERVICE_TWO_ID, name='5', restricted=False, active=True), # live, member of
]
)
@@ -120,8 +121,8 @@ def test_organisation_services_shows_live_services_only(
assert normalize_spaces(services[0].text) == '1'
assert normalize_spaces(services[1].text) == '5'
assert services[0].find('a') is None
assert services[1].find('a')['href'] == url_for('main.service_dashboard', service_id=SERVICE_ONE_ID)
assert services[0].find('a')['href'] == url_for('main.service_dashboard', service_id=SERVICE_ONE_ID)
assert services[1].find('a')['href'] == url_for('main.service_dashboard', service_id=SERVICE_TWO_ID)
def test_organisation_trial_mode_services_shows_all_non_live_services(