From 3865c5b952af5fddf81ca05e7b1a4ca047c9045e Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Tue, 8 Oct 2024 10:36:35 -0400 Subject: [PATCH 1/5] Update to address a11y issue of "Broken Aria link" in the dialog --- app/templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/base.html b/app/templates/base.html index efa6c7408..523a20c0a 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -82,7 +82,7 @@ {% if current_user.is_authenticated %} {% block sessionUserWarning %} - +

From 65c99bf8e84f71458e11c6a056161aeeddc6a80c Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Tue, 8 Oct 2024 16:12:50 -0400 Subject: [PATCH 2/5] Removing instances of a financial year --- app/utils/time.py | 3 +-- tests/app/utils/test_time.py | 14 -------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/app/utils/time.py b/app/utils/time.py index e2f4a8e36..95ce891c1 100644 --- a/app/utils/time.py +++ b/app/utils/time.py @@ -9,9 +9,8 @@ from app.utils.csv import get_user_preferred_timezone def get_current_financial_year(): preferred_tz = pytz.timezone(get_user_preferred_timezone()) now = datetime.now(preferred_tz) - current_month = int(now.strftime("%-m")) current_year = int(now.strftime("%Y")) - return current_year if current_month < 10 else current_year + 1 + return current_year def is_less_than_days_ago(date_from_db, number_of_days): diff --git a/tests/app/utils/test_time.py b/tests/app/utils/test_time.py index ae51edb97..023755aa4 100644 --- a/tests/app/utils/test_time.py +++ b/tests/app/utils/test_time.py @@ -15,17 +15,3 @@ from app.utils.time import get_current_financial_year, is_less_than_days_ago @freeze_time("2020-02-14T12:00:00") def test_is_less_than_days_ago(date_from_db, expected_result): assert is_less_than_days_ago(date_from_db, 90) == expected_result - - -@pytest.mark.parametrize( - ("datetime_string", "financial_year"), - [ - ("2021-01-01T00:00:00+00:00", 2021), # Start of 2021 - ("2021-04-01T03:59:59+00:00", 2021), # One minute before midnight (BST) - ("2021-10-01T04:05:00+00:00", 2022), # Midnight (BST) - ("2021-12-12T12:12:12+01:00", 2022), # Later in the year - ], -) -def test_get_financial_year(datetime_string, financial_year): - with freeze_time(datetime_string): - assert get_current_financial_year() == financial_year From 947f85ba514324f009162157ad603641a91b51e6 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Tue, 8 Oct 2024 16:24:03 -0400 Subject: [PATCH 3/5] This was from a previous commit --- app/templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/base.html b/app/templates/base.html index 523a20c0a..efa6c7408 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -82,7 +82,7 @@ {% if current_user.is_authenticated %} {% block sessionUserWarning %} - +

From 3ad6f9daaeff2078a1197f7928140f44fcc2b2bf Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Tue, 8 Oct 2024 16:37:33 -0400 Subject: [PATCH 4/5] Removing reference to financial year --- tests/app/utils/test_time.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app/utils/test_time.py b/tests/app/utils/test_time.py index 023755aa4..78e0bd96f 100644 --- a/tests/app/utils/test_time.py +++ b/tests/app/utils/test_time.py @@ -1,7 +1,7 @@ import pytest from freezegun import freeze_time -from app.utils.time import get_current_financial_year, is_less_than_days_ago +from app.utils.time import is_less_than_days_ago @pytest.mark.parametrize( From 5adcfae5d84f62803a1b46ae9f54aeafdfc54dfc Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Wed, 9 Oct 2024 09:56:19 -0400 Subject: [PATCH 5/5] Fixing a test --- tests/app/main/views/organizations/test_organizations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app/main/views/organizations/test_organizations.py b/tests/app/main/views/organizations/test_organizations.py index 27663ad22..0e781ab82 100644 --- a/tests/app/main/views/organizations/test_organizations.py +++ b/tests/app/main/views/organizations/test_organizations.py @@ -610,7 +610,7 @@ def test_organization_services_links_to_downloadable_report( assert link_to_report.attrs["href"] == url_for( ".download_organization_usage_report", org_id=ORGANISATION_ID, - selected_year=2022, + selected_year=2021, )