Skip to content

Commit cb2f78a

Browse files
authored
Merge pull request #308 from NHSDigital/migrate-consent-page
Migrate consent page
2 parents 770ee2c + 97dedcc commit cb2f78a

File tree

8 files changed

+382
-438
lines changed

8 files changed

+382
-438
lines changed

mavis/test/fixtures/models.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def children_page(page, dashboard_page):
3232

3333

3434
@pytest.fixture
35-
def consent_page(playwright_operations):
36-
return ConsentPage(playwright_operations)
35+
def consent_page(page):
36+
return ConsentPage(page)
3737

3838

3939
@pytest.fixture
@@ -57,8 +57,8 @@ def download_school_moves_page(page):
5757

5858

5959
@pytest.fixture
60-
def import_records_page(test_data, page, dashboard_page, children_page):
61-
return ImportRecordsPage(test_data, page, dashboard_page, children_page)
60+
def import_records_page(test_data, page, children_page):
61+
return ImportRecordsPage(test_data, page, children_page)
6262

6363

6464
@pytest.fixture
@@ -88,14 +88,20 @@ def school_moves_page(page):
8888

8989
@pytest.fixture
9090
def sessions_page(
91-
test_data, playwright_operations, dashboard_page, children_page, import_records_page
91+
test_data,
92+
playwright_operations,
93+
dashboard_page,
94+
children_page,
95+
import_records_page,
96+
consent_page,
9297
):
9398
return SessionsPage(
9499
test_data,
95100
playwright_operations,
96101
dashboard_page,
97102
children_page,
98103
import_records_page,
104+
consent_page,
99105
)
100106

101107

mavis/test/mavis_constants.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ class PrescreeningQuestion(StrEnum):
9898
NOT_PREGNANT = "are not pregnant"
9999

100100

101+
class ConsentRefusalReason(StrEnum):
102+
VACCINE_ALREADY_RECEIVED = "Vaccine already received"
103+
VACCINE_WILL_BE_GIVEN_ELSEWHERE = "Vaccine will be given elsewhere"
104+
MEDICAL_REASONS = "Medical reasons"
105+
PERSONAL_CHOICE = "Personal choice"
106+
OTHER = "Other"
107+
108+
@property
109+
def requires_details(self) -> bool:
110+
return self is not ConsentRefusalReason.PERSONAL_CHOICE
111+
112+
113+
class ConsentMethod(StrEnum):
114+
PHONE = "By phone"
115+
PAPER = "Paper"
116+
IN_PERSON = "In person"
117+
118+
101119
class mavis_file_types(Enum):
102120
CHILD_LIST = auto()
103121
COHORT = auto()

0 commit comments

Comments
 (0)