From 14a3420fbe6a6ed1ef2e5709a0865801fd742314 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 12 Jun 2019 09:50:11 +0100 Subject: [PATCH] =?UTF-8?q?Split=20list=20of=20user=E2=80=99s=20services?= =?UTF-8?q?=20into=20live=20and=20trial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This gives us as platform admin users a bit more context when we’re looking at a user’s profile. --- .../views/find-users/user-information.html | 38 +++++++++++++++---- tests/app/main/views/test_find_users.py | 14 ++++--- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/app/templates/views/find-users/user-information.html b/app/templates/views/find-users/user-information.html index eb180ee74..02f772017 100644 --- a/app/templates/views/find-users/user-information.html +++ b/app/templates/views/find-users/user-information.html @@ -13,15 +13,37 @@

{{ user.email_address }}

{{ user.mobile_number }}

-

Services

+

Live services

+

Trial mode services

+

Last login

{% if not user.logged_in_at %} diff --git a/tests/app/main/views/test_find_users.py b/tests/app/main/views/test_find_users.py index 703cae515..c5de5b594 100644 --- a/tests/app/main/views/test_find_users.py +++ b/tests/app/main/views/test_find_users.py @@ -101,8 +101,8 @@ def test_user_information_page_shows_information_about_user( mocker.patch( 'app.user_api_client.get_organisations_and_services_for_user', return_value={'organisations': [], 'services_without_organisations': [ - {"id": 1, "name": "Fresh Orchard Juice"}, - {"id": 2, "name": "Nature Therapy"}, + {"id": 1, "name": "Fresh Orchard Juice", "restricted": True}, + {"id": 2, "name": "Nature Therapy", "restricted": False}, ]}, autospec=True ) @@ -116,10 +116,12 @@ def test_user_information_page_shows_information_about_user( assert document.xpath("//p/text()[normalize-space()='test@gov.uk']") assert document.xpath("//p/text()[normalize-space()='+447700900986']") - assert document.xpath("//h2/text()[normalize-space()='Services']") - assert document.xpath("//a/text()[normalize-space()='Fresh Orchard Juice']") + assert document.xpath("//h2/text()[normalize-space()='Live services']") assert document.xpath("//a/text()[normalize-space()='Nature Therapy']") + assert document.xpath("//h2/text()[normalize-space()='Trial mode services']") + assert document.xpath("//a/text()[normalize-space()='Fresh Orchard Juice']") + assert document.xpath("//h2/text()[normalize-space()='Last login']") assert not document.xpath("//p/text()[normalize-space()='0 failed login attempts']") @@ -137,8 +139,8 @@ def test_user_information_page_displays_if_there_are_failed_login_attempts( mocker.patch( 'app.user_api_client.get_organisations_and_services_for_user', return_value={'organisations': [], 'services_without_organisations': [ - {"id": 1, "name": "Fresh Orchard Juice"}, - {"id": 2, "name": "Nature Therapy"}, + {"id": 1, "name": "Fresh Orchard Juice", "restricted": True}, + {"id": 2, "name": "Nature Therapy", "restricted": True}, ]}, autospec=True )