From f30b484704152f92f3c8d3c3fdcdf1126f22685f Mon Sep 17 00:00:00 2001 From: Henry Cooksley Date: Tue, 14 Jan 2025 09:49:46 +0000 Subject: [PATCH] Fix table data to use govuk table cell class --- .../goods-locations/goods-locations.html | 2 +- .../templates/organisation/members/index.html | 2 +- .../templates/organisation/roles/index.html | 2 +- .../templates/organisation/sites/index.html | 2 +- .../organisation/members/test_templates.py | 17 +++++++++++------ 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/exporter/templates/applications/goods-locations/goods-locations.html b/exporter/templates/applications/goods-locations/goods-locations.html index 3b436213b1..13086c27dc 100644 --- a/exporter/templates/applications/goods-locations/goods-locations.html +++ b/exporter/templates/applications/goods-locations/goods-locations.html @@ -73,7 +73,7 @@

{% for location in application.goods_locations.data %} {% if application.goods_locations.type == 'sites' %} - {{ location.name }} + {{ location.name }} {{ location|get_address }} diff --git a/exporter/templates/organisation/members/index.html b/exporter/templates/organisation/members/index.html index fe22f20561..1dcc6aed2c 100644 --- a/exporter/templates/organisation/members/index.html +++ b/exporter/templates/organisation/members/index.html @@ -22,7 +22,7 @@ {% for user in data.results %} - + {% if not user.pending %} {{ user.first_name }} {{ user.last_name }} {% else %} diff --git a/exporter/templates/organisation/roles/index.html b/exporter/templates/organisation/roles/index.html index 32959aeb7e..1933f7a62f 100644 --- a/exporter/templates/organisation/roles/index.html +++ b/exporter/templates/organisation/roles/index.html @@ -16,7 +16,7 @@ {% for role in roles.results %} - + {{ role.name }} diff --git a/exporter/templates/organisation/sites/index.html b/exporter/templates/organisation/sites/index.html index 09ce5fe4ef..fc6f8df095 100644 --- a/exporter/templates/organisation/sites/index.html +++ b/exporter/templates/organisation/sites/index.html @@ -28,7 +28,7 @@ {% for site in sites %} - + {{ site.name }} {% if site.id == organisation.primary_site.id %} (Registered office address) diff --git a/unit_tests/exporter/organisation/members/test_templates.py b/unit_tests/exporter/organisation/members/test_templates.py index ddf63ebe03..2752a9785b 100644 --- a/unit_tests/exporter/organisation/members/test_templates.py +++ b/unit_tests/exporter/organisation/members/test_templates.py @@ -8,8 +8,8 @@ def test_pending_users_in_organisation(): context["data"] = { "results": [ { - "id": "11c74ddd-c119-48cc-8696-e096218ca583", - "email": "jane.doe@example.com", + "id": "11c74ddd-c119-48cc-8696-e096218ca583", # /PS-IGNORE + "email": "jane.doe@example.com", # /PS-IGNORE "first_name": "", "last_name": "", "status": "Active", @@ -18,8 +18,8 @@ def test_pending_users_in_organisation(): "phone_number": "", }, { - "id": "2a43805b-c082-47e7-9188-c8b3e1a83cb0", - "email": "john.smith@example.com", + "id": "2a43805b-c082-47e7-9188-c8b3e1a83cb0", # /PS-IGNORE + "email": "john.smith@example.com", # /PS-IGNORE "first_name": "John", "last_name": "Smith", "status": "Active", @@ -33,8 +33,13 @@ def test_pending_users_in_organisation(): soup = BeautifulSoup(html, "html.parser") rows = soup.find("tbody", {"class": "govuk-table__body"}).find_all("tr", recursive=False) assert rows[0].find(class_="govuk-tag govuk-tag--blue").text.strip() == "Pending" - assert rows[1].find(class_="govuk-table__header").text.strip() == "John Smith" - values_for_assert = ["john.smith@example.com", "Administrator", "Active", "View John Smith's profile"] + values_for_assert = [ + "John Smith", + "john.smith@example.com", # /PS-IGNORE + "Administrator", + "Active", + "View John Smith's profile", + ] for index, value in enumerate(rows[1].find_all(class_="govuk-table__cell")): assert values_for_assert[index] == value.text.strip()