diff --git a/poetry.lock b/poetry.lock index 6a993ead..5f7e3966 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -929,23 +929,24 @@ yaml = ["PyYAML (>=5.4.1)"] [[package]] name = "flask" -version = "3.1.0" +version = "3.1.1" description = "A simple framework for building complex web applications." optional = false python-versions = ">=3.9" groups = ["main"] files = [ - {file = "flask-3.1.0-py3-none-any.whl", hash = "sha256:d667207822eb83f1c4b50949b1623c8fc8d51f2341d65f72e1a1815397551136"}, - {file = "flask-3.1.0.tar.gz", hash = "sha256:5f873c5184c897c8d9d1b05df1e3d01b14910ce69607a117bd3277098a5836ac"}, + {file = "flask-3.1.1-py3-none-any.whl", hash = "sha256:07aae2bb5eaf77993ef57e357491839f5fd9f4dc281593a81a9e4d79a24f295c"}, + {file = "flask-3.1.1.tar.gz", hash = "sha256:284c7b8f2f58cb737f0cf1c30fd7eaf0ccfcde196099d24ecede3fc2005aa59e"}, ] [package.dependencies] asgiref = {version = ">=3.2", optional = true, markers = "extra == \"async\""} -blinker = ">=1.9" +blinker = ">=1.9.0" click = ">=8.1.3" -itsdangerous = ">=2.2" -Jinja2 = ">=3.1.2" -Werkzeug = ">=3.1" +itsdangerous = ">=2.2.0" +jinja2 = ">=3.1.2" +markupsafe = ">=2.1.1" +werkzeug = ">=3.1.0" [package.extras] async = ["asgiref (>=3.2)"] @@ -3133,4 +3134,4 @@ propcache = ">=0.2.1" [metadata] lock-version = "2.1" python-versions = "^3.13" -content-hash = "c1e2514b7c8ae6600cc0836851b3fa2b4b682a32b61159ce2c5c951fdadc2e57" +content-hash = "dfb17c7d1a45486728256905fef6d69687876aeb0928c4928b291567d351e559" diff --git a/pyproject.toml b/pyproject.toml index ef5ee060..49f903c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry.dependencies] python = "^3.13" -flask = {extras = ["async"], version = "^3.1.0"} +flask = {extras = ["async"], version = "^3.1.1"} httpx = "^0.28.1" yarl = "^1.18.3" pydantic = "^2.10.6" diff --git a/tests/unit/services/calculators/test_eligibility_calculator.py b/tests/unit/services/calculators/test_eligibility_calculator.py index adccfd9d..3d4c085b 100644 --- a/tests/unit/services/calculators/test_eligibility_calculator.py +++ b/tests/unit/services/calculators/test_eligibility_calculator.py @@ -622,10 +622,11 @@ def test_base_eligible_and_icb_example( @pytest.mark.parametrize( ("last_successful_date", "expected_status", "test_comment"), [ - ("20240101", Status.not_actionable, "last_successful_date is a past date"), + ("20240601", Status.not_actionable, "last_successful_date is a past date"), ("20250101", Status.not_actionable, "last_successful_date is today"), # Below is a non-ideal situation (might be due to a data entry error), so considered as actionable. ("20260101", Status.actionable, "last_successful_date is a future date"), + ("20230601", Status.actionable, "last_successful_date is a long past"), ("", Status.actionable, "last_successful_date is empty"), (None, Status.actionable, "last_successful_date is none"), ], @@ -658,14 +659,28 @@ def test_not_actionable_status_on_target_when_last_successful_date_lte_today( iteration_rules=[ rule_builder.IterationRuleFactory.build( type=rules.RuleType.suppression, - name=rules.RuleName("You have already been vaccinated against RSV"), - description=rules.RuleDescription("Exclude anyone Completed RSV Vaccination"), + name=rules.RuleName("You have already been vaccinated against RSV in the last year"), + description=rules.RuleDescription( + "Exclude anyone Completed RSV Vaccination in the last year" + ), + priority=10, + operator=rules.RuleOperator.day_gte, + attribute_level=rules.RuleAttributeLevel.TARGET, + attribute_name=rules.RuleAttributeName("LAST_SUCCESSFUL_DATE"), + comparator=rules.RuleComparator("-365"), + attribute_target=rules.RuleAttributeTarget("RSV"), + ), + rule_builder.IterationRuleFactory.build( + type=rules.RuleType.suppression, + name=rules.RuleName("You have a future booking to be vaccinated against RSV"), + description=rules.RuleDescription("Exclude anyone with future Completed RSV Vaccination"), + priority=10, operator=rules.RuleOperator.day_lte, attribute_level=rules.RuleAttributeLevel.TARGET, attribute_name=rules.RuleAttributeName("LAST_SUCCESSFUL_DATE"), comparator=rules.RuleComparator("0"), attribute_target=rules.RuleAttributeTarget("RSV"), - ) + ), ], iteration_cohorts=[rule_builder.IterationCohortFactory.build(cohort_label="cohort1")], )