Skip to content

Commit 084ec7b

Browse files
Test/already vaccinated long ago (#98)
* more test for already vaccinated scenarios | Simon * flask - CVE-2025-47278 - vulnerability fixes
1 parent 45c34fb commit 084ec7b

File tree

3 files changed

+30
-14
lines changed

3 files changed

+30
-14
lines changed

poetry.lock

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ build-backend = "poetry.core.masonry.api"
2121

2222
[tool.poetry.dependencies]
2323
python = "^3.13"
24-
flask = {extras = ["async"], version = "^3.1.0"}
24+
flask = {extras = ["async"], version = "^3.1.1"}
2525
httpx = "^0.28.1"
2626
yarl = "^1.18.3"
2727
pydantic = "^2.10.6"

tests/unit/services/calculators/test_eligibility_calculator.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,10 +622,11 @@ def test_base_eligible_and_icb_example(
622622
@pytest.mark.parametrize(
623623
("last_successful_date", "expected_status", "test_comment"),
624624
[
625-
("20240101", Status.not_actionable, "last_successful_date is a past date"),
625+
("20240601", Status.not_actionable, "last_successful_date is a past date"),
626626
("20250101", Status.not_actionable, "last_successful_date is today"),
627627
# Below is a non-ideal situation (might be due to a data entry error), so considered as actionable.
628628
("20260101", Status.actionable, "last_successful_date is a future date"),
629+
("20230601", Status.actionable, "last_successful_date is a long past"),
629630
("", Status.actionable, "last_successful_date is empty"),
630631
(None, Status.actionable, "last_successful_date is none"),
631632
],
@@ -658,14 +659,28 @@ def test_not_actionable_status_on_target_when_last_successful_date_lte_today(
658659
iteration_rules=[
659660
rule_builder.IterationRuleFactory.build(
660661
type=rules.RuleType.suppression,
661-
name=rules.RuleName("You have already been vaccinated against RSV"),
662-
description=rules.RuleDescription("Exclude anyone Completed RSV Vaccination"),
662+
name=rules.RuleName("You have already been vaccinated against RSV in the last year"),
663+
description=rules.RuleDescription(
664+
"Exclude anyone Completed RSV Vaccination in the last year"
665+
),
666+
priority=10,
667+
operator=rules.RuleOperator.day_gte,
668+
attribute_level=rules.RuleAttributeLevel.TARGET,
669+
attribute_name=rules.RuleAttributeName("LAST_SUCCESSFUL_DATE"),
670+
comparator=rules.RuleComparator("-365"),
671+
attribute_target=rules.RuleAttributeTarget("RSV"),
672+
),
673+
rule_builder.IterationRuleFactory.build(
674+
type=rules.RuleType.suppression,
675+
name=rules.RuleName("You have a future booking to be vaccinated against RSV"),
676+
description=rules.RuleDescription("Exclude anyone with future Completed RSV Vaccination"),
677+
priority=10,
663678
operator=rules.RuleOperator.day_lte,
664679
attribute_level=rules.RuleAttributeLevel.TARGET,
665680
attribute_name=rules.RuleAttributeName("LAST_SUCCESSFUL_DATE"),
666681
comparator=rules.RuleComparator("0"),
667682
attribute_target=rules.RuleAttributeTarget("RSV"),
668-
)
683+
),
669684
],
670685
iteration_cohorts=[rule_builder.IterationCohortFactory.build(cohort_label="cohort1")],
671686
)

0 commit comments

Comments
 (0)