Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions .gitleaksignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# SEE: https://github.com/gitleaks/gitleaks/blob/master/README.md#gitleaksignore

cd9c0efec38c5d63053dd865e5d4e207c0760d91:docs/guides/Perform_static_analysis.md:generic-api-key:37
infrastructure/terraform/resource_group_init/core.bicep:generic-api-key:10
infrastructure/terraform/resource_group_init/core.bicep:generic-api-key:11
infrastructure/terraform/resource_group_init/core.bicep:generic-api-key:12
infrastructure/terraform/resource_group_init/main.bicep:generic-api-key:29
infrastructure/terraform/resource_group_init/main.bicep:generic-api-key:30
infrastructure/terraform/resource_group_init/main.bicep:generic-api-key:31
infrastructure/terraform/resource_group_init/main.bicep:generic-api-key:32
infrastructure/terraform/resource_group_init/main.bicep:generic-api-key:33
infrastructure/terraform/resource_group_init/storage.bicep:generic-api-key:59
infrastructure/terraform/resource_group_init/keyVault.bicep:generic-api-key:10
infrastructure/terraform/spoke/resource_group_init/core.bicep:generic-api-key:10
infrastructure/terraform/spoke/resource_group_init/core.bicep:generic-api-key:11
infrastructure/terraform/spoke/resource_group_init/core.bicep:generic-api-key:12
infrastructure/terraform/spoke/resource_group_init/main.bicep:generic-api-key:29
infrastructure/terraform/spoke/resource_group_init/main.bicep:generic-api-key:30
infrastructure/terraform/spoke/resource_group_init/main.bicep:generic-api-key:31
infrastructure/terraform/spoke/resource_group_init/main.bicep:generic-api-key:32
infrastructure/terraform/spoke/resource_group_init/main.bicep:generic-api-key:33
infrastructure/terraform/spoke/resource_group_init/storage.bicep:generic-api-key:59
infrastructure/terraform/spoke/resource_group_init/keyVault.bicep:generic-api-key:10
infrastructure/bootstrap/core.bicep:generic-api-key:10
infrastructure/bootstrap/core.bicep:generic-api-key:11
infrastructure/bootstrap/core.bicep:generic-api-key:12
Expand All @@ -21,10 +20,17 @@ infrastructure/bootstrap/hub.bicep:generic-api-key:56
infrastructure/bootstrap/hub.bicep:generic-api-key:57
infrastructure/bootstrap/hub.bicep:generic-api-key:58
infrastructure/bootstrap/hub.bicep:generic-api-key:59
infrastructure/bootstrap/hub.bicep:generic-api-key:60
infrastructure/bootstrap/hub.bicep:generic-api-key:61
infrastructure/bootstrap/main.bicep:generic-api-key:29
infrastructure/bootstrap/main.bicep:generic-api-key:30
infrastructure/bootstrap/main.bicep:generic-api-key:31
infrastructure/bootstrap/main.bicep:generic-api-key:32
infrastructure/bootstrap/main.bicep:generic-api-key:33
infrastructure/bootstrap/modules/storage.bicep:generic-api-key:59
infrastructure/bootstrap/modules/keyVault.bicep:generic-api-key:10
infrastructure/bootstrap/modules/storage.bicep:generic-api-key:59
infrastructure/terraform/hub/data.tf:generic-api-key:18
infrastructure/terraform/hub/data.tf:generic-api-key:22
infrastructure/terraform/resource_group_init/core.bicep:generic-api-key:11
infrastructure/terraform/resource_group_init/keyVault.bicep:generic-api-key:10
infrastructure/terraform/resource_group_init/main.bicep:generic-api-key:30
2 changes: 2 additions & 0 deletions features/cancer_diagnosis.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@CancerDiagnosis
Feature: Cancer diagnosis page
Scenario: The page is accessible
Given I am logged in
Expand Down Expand Up @@ -28,6 +29,7 @@ Feature: Cancer diagnosis page
And I see "/cancer-diagnosis?change=True" as a link to change "Have you ever been diagnosed with cancer?" under "Your health"
When I click the link to change "Have you ever been diagnosed with cancer?" under "Your health"
Then I am on "/cancer-diagnosis?change=True"
And I see "No" selected
When I fill in and submit my cancer diagnosis with "Yes"
Then I am on "/check-your-answers"
And I see "Yes" as a response to "Have you ever been diagnosed with cancer?" under "Your health"
6 changes: 6 additions & 0 deletions features/check_need_appointment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ Feature: Check if you need an appointment page
When I check "No, I can continue online" and submit
Then I am on "/height"

Scenario: Checking responses and changing them
Given I am logged in
When I go to "/check-if-you-need-an-appointment"
And I check "No, I can continue online" and submit
When I click "Back"
Then I see "No, I can continue online" selected

2 changes: 2 additions & 0 deletions features/education.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@Education
Feature: Education page
Scenario: The page is accessible
Given I am logged in
Expand Down Expand Up @@ -28,6 +29,7 @@ Feature: Education page
And I see "/education?change=True" as a link to change "Highest level of education" under "About you"
When I click the link to change "Highest level of education" under "About you"
Then I am on "/education?change=True"
And I see "A-levels" selected
When I fill in and submit my education with "GCSEs"
Then I am on "/check-your-answers"
And I see "GCSEs" as a response to "Highest level of education" under "About you"
Expand Down
2 changes: 2 additions & 0 deletions features/ethnicity.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@Ethnicity
Feature: Ethnicity page
Scenario: The page is accessible
Given I am logged in
Expand Down Expand Up @@ -28,6 +29,7 @@ Feature: Ethnicity page
And I see "/ethnicity?change=True" as a link to change "Ethnic group" under "About you"
When I click the link to change "Ethnic group" under "About you"
Then I am on "/ethnicity?change=True"
And I see "White" selected
When I fill in and submit my ethnicity with "Black, African, Caribbean or Black British"
Then I am on "/check-your-answers"
And I see "Black, African, Caribbean or Black British" as a response to "Ethnic group" under "About you"
Expand Down
2 changes: 2 additions & 0 deletions features/family_history_lung_cancer.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@FamilyHistoryLungCancer
Feature: Family history of lung cancer page
Scenario: The page is accessible
Given I am logged in
Expand Down Expand Up @@ -31,6 +32,7 @@ Feature: Family history of lung cancer page
And I see "/family-history-lung-cancer?change=True" as a link to change "Have any of your parents, siblings or children ever been diagnosed with lung cancer? " under "Family history"
When I click the link to change "Have any of your parents, siblings or children ever been diagnosed with lung cancer? " under "Family history"
Then I am on "/family-history-lung-cancer?change=True"
And I see "No" selected
When I fill in and submit my family history lung cancer with "Yes"
Then I am on "/relatives-age-when-diagnosed?change=True"
When I fill in and submit my relatives age when diagnosed with "Yes, they were younger than 60"
Expand Down
2 changes: 2 additions & 0 deletions features/gender.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@Gender
Feature: Gender page
Scenario: The page is accessible
Given I am logged in
Expand Down Expand Up @@ -28,6 +29,7 @@ Feature: Gender page
And I see "/gender?change=True" as a link to change "Gender identity" under "About you"
When I click the link to change "Gender identity" under "About you"
Then I am on "/gender?change=True"
And I see "Female" selected
When I fill in and submit my gender with "Female"
Then I am on "/check-your-answers"
And I see "Female" as a response to "Gender identity" under "About you"
Expand Down
2 changes: 2 additions & 0 deletions features/have_you_ever_smoked_page.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@HaveYouEverSmoked
Feature: Have you ever smoked page
Scenario: The page is accessible
Given I am logged in
Expand Down Expand Up @@ -36,6 +37,7 @@ Feature: Have you ever smoked page
And I see "/have-you-ever-smoked?change=True" as a link to change "Have you ever smoked tobacco?" under "Eligibility"
When I click the link to change "Have you ever smoked tobacco?" under "Eligibility"
Then I am on "/have-you-ever-smoked?change=True"
And I see "Yes, I used to smoke" selected
When I fill in and submit my smoking status with "Yes, I currently smoke"
Then I am on "/check-your-answers"
And I see "Yes, I currently smoke" as a response to "Have you ever smoked tobacco?" under "Eligibility"
10 changes: 10 additions & 0 deletions features/height.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@Height
Feature: Height page
Scenario: The page is accessible
Given I am logged in
Expand Down Expand Up @@ -59,8 +60,17 @@ Feature: Height page
And I see "/height?change=True" as a link to change "Height" under "About you"
When I click the link to change "Height" under "About you"
Then I am on "/height?change=True"
And I see "170.0" filled in for "Centimetres"
When I click "Switch to feet and inches"
And I fill in and submit my height with "5" feet and "7" inches
Then I am on "/check-your-answers"
And I see "5 feet 7 inches" as a response to "Height" under "About you"
When I click the link to change "Height" under "About you"
Then I am on "/height?change=True"
And I see "5" filled in for "Feet"
And I see "7" filled in for "Inches"
When I click "Switch to centimetres"
And I fill in and submit my height with "170.4"
Then I am on "/check-your-answers"
And I see "170.4 cm" as a response to "Height" under "About you"

2 changes: 2 additions & 0 deletions features/relatives_age_when_diagnosed.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@RelativesAgeWhenDiagnosed
Feature: Relatives age when diagnosed page
Scenario: The page is accessible
Given I am logged in
Expand Down Expand Up @@ -40,6 +41,7 @@ Feature: Relatives age when diagnosed page
And I see "/relatives-age-when-diagnosed?change=True" as a link to change "Were any of your relatives younger than 60 years old when they were diagnosed with lung cancer?" under "Family history"
When I click the link to change "Were any of your relatives younger than 60 years old when they were diagnosed with lung cancer?" under "Family history"
Then I am on "/relatives-age-when-diagnosed?change=True"
And I see "Yes, they were younger than 60" selected
When I fill in and submit my relatives age when diagnosed with "No, they were 60 or older"
Then I am on "/check-your-answers"
And I see "No, they were 60 or older" as a response to "Were any of your relatives younger than 60 years old when they were diagnosed with lung cancer?" under "Family history"
3 changes: 3 additions & 0 deletions features/respiratory_conditions.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@RespiratoryConditions
Feature: Respiratory conditions page
Scenario: The page is accessible
Given I am logged in
Expand Down Expand Up @@ -31,6 +32,8 @@ Feature: Respiratory conditions page
And I see "/respiratory-conditions?change=True" as a link to change "Diagnosed respiratory conditions" under "Your health"
When I click the link to change "Diagnosed respiratory conditions" under "Your health"
Then I am on "/respiratory-conditions?change=True"
And I see "Pneumonia" selected
And I see "Emphysema" selected
When I fill in and submit my respiratory conditions with "Bronchitis" and "Tuberculosis (TB)"
Then I am on "/check-your-answers"
And I see "Pneumonia, Emphysema, Bronchitis, and Tuberculosis (TB)" as a response to "Diagnosed respiratory conditions" under "Your health"
Expand Down
2 changes: 2 additions & 0 deletions features/sex_at_birth.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@SexAtBirth
Feature: Sex at birth page
Scenario: The page is accessible
Given I am logged in
Expand Down Expand Up @@ -28,6 +29,7 @@ Feature: Sex at birth page
And I see "/sex-at-birth?change=True" as a link to change "Sex at birth" under "About you"
When I click the link to change "Sex at birth" under "About you"
Then I am on "/sex-at-birth?change=True"
And I see "Male" selected
When I fill in and submit my sex at birth with "Female"
Then I am on "/check-your-answers"
And I see "Female" as a response to "Sex at birth" under "About you"
Expand Down
4 changes: 4 additions & 0 deletions features/steps/form_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ def then_i_see_a_date_x_years_ago_filled_in(context, years):
assert context.page.get_by_label('Day').input_value() == str(date_of_birth.day)
assert context.page.get_by_label('Month').input_value() == str(date_of_birth.month)
assert context.page.get_by_label('Year').input_value() == str(date_of_birth.year)

@then(u'I see "{value}" filled in for "{label}"')
def then_i_see_value_filled_in_for_label(context, value, label):
assert context.page.get_by_label(label, exact=True).input_value() == value
10 changes: 10 additions & 0 deletions features/weight.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@Weight
Feature: Weight page
Scenario: The page is accessible
Given I am logged in
Expand Down Expand Up @@ -62,8 +63,17 @@ Feature: Weight page
And I see "/weight?change=True" as a link to change "Weight" under "About you"
When I click the link to change "Weight" under "About you"
Then I am on "/weight?change=True"
And I see "70.0" filled in for "Kilograms"
When I click "Switch to stone and pounds"
And I fill in and submit my weight with "5" stone and "10" pounds
Then I am on "/check-your-answers"
And I see "5 stone 10 pounds" as a response to "Weight" under "About you"
When I click the link to change "Weight" under "About you"
Then I am on "/weight?change=True"
And I see "5" filled in for "Stone"
And I see "10" filled in for "Pounds"
When I click "Switch to kilograms"
And I fill in and submit my weight with "70.4"
Then I am on "/check-your-answers"
And I see "70.4 kg" as a response to "Weight" under "About you"

Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ class HaveYouEverSmokedValues(models.IntegerChoices):
class HaveYouEverSmokedResponse(BaseModel):
response_set = models.OneToOneField(ResponseSet, on_delete=models.CASCADE, related_name='have_you_ever_smoked_response')
value = models.IntegerField(choices=HaveYouEverSmokedValues.choices)

def has_smoked_regularly(self):
return self.value in [
HaveYouEverSmokedValues.YES_I_USED_TO_SMOKE_REGULARLY.value,
HaveYouEverSmokedValues.YES_I_CURRENTLY_SMOKE.value
]
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.test import TestCase
from django.test import TestCase, tag

from ...factories.response_set_factory import ResponseSetFactory
from ....models.ethnicity_response import EthnicityResponse, EthnicityValues
from ....forms.ethnicity_form import EthnicityForm


@tag("Ethnicity")
class TestEthnicityForm(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.test import TestCase
from django.test import TestCase, tag

from ...factories.response_set_factory import ResponseSetFactory
from ....models.gender_response import GenderResponse, GenderValues
from ....forms.gender_form import GenderForm


@tag("Gender")
class TestGenderForm(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.test import TestCase
from django.test import TestCase, tag

from ...factories.response_set_factory import ResponseSetFactory
from ....models.have_you_ever_smoked_response import HaveYouEverSmokedResponse, HaveYouEverSmokedValues
from ....forms.have_you_ever_smoked_form import HaveYouEverSmokedForm


@tag("HaveYouEverSmoked")
class TestHaveYouEverSmokedForm(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.test import TestCase
from django.test import TestCase, tag

from ...factories.response_set_factory import ResponseSetFactory
from ....models.height_response import HeightResponse
from ....forms.imperial_height_form import ImperialHeightForm


@tag("Height")
class TestImperialHeightForm(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.test import TestCase
from django.test import TestCase, tag

from ...factories.response_set_factory import ResponseSetFactory
from ....models.weight_response import WeightResponse
from ....forms.imperial_weight_form import ImperialWeightForm


@tag("Weight")
class TestImperialWeightForm(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.test import TestCase
from django.test import TestCase, tag

from ...factories.response_set_factory import ResponseSetFactory
from ....models.height_response import HeightResponse
from ....forms.metric_height_form import MetricHeightForm


@tag("Height")
class TestMetricHeightForm(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.test import TestCase
from django.test import TestCase, tag

from ...factories.response_set_factory import ResponseSetFactory
from ....models.weight_response import WeightResponse
from ....forms.metric_weight_form import MetricWeightForm


@tag("Weight")
class TestMetricWeightForm(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ....models.relatives_age_when_diagnosed_response import RelativesAgeWhenDiagnosedResponse, RelativesAgeWhenDiagnosedValues
from ....forms.relatives_age_when_diagnosed_form import RelativesAgeWhenDiagnosedForm

@tag("FamilyHistoryLungCancer")
@tag("RelativesAgeWhenDiagnosed")
class TestRelativesLungCancerForm(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.test import TestCase
from django.test import TestCase, tag

from ...factories.response_set_factory import ResponseSetFactory
from ....models.respiratory_conditions_response import RespiratoryConditionsResponse
from ....forms.respiratory_conditions_form import RespiratoryConditionsForm


@tag("RespiratoryConditions")
class TestRespiratoryConditionsForm(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from django.test import TestCase
from django.test import TestCase, tag

from ...factories.response_set_factory import ResponseSetFactory
from ....models.sex_at_birth_response import SexAtBirthResponse, SexAtBirthValues
from ....forms.sex_at_birth_form import SexAtBirthForm


@tag("SexAtBirth")
class TestSexAtBirthForm(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from django.test import TestCase
from django.test import TestCase, tag

from ...factories.response_set_factory import ResponseSetFactory
from ...factories.ethnicity_response_factory import EthnicityResponseFactory

from ....models.ethnicity_response import EthnicityResponse, EthnicityValues


@tag("Ethnicity")
class TestEthnicityResponse(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from django.test import TestCase
from django.test import TestCase, tag

from ...factories.response_set_factory import ResponseSetFactory
from ...factories.gender_response_factory import GenderResponseFactory

from ....models.gender_response import GenderResponse, GenderValues


@tag("Gender")
class TestGenderResponse(TestCase):
def setUp(self):
self.response_set = ResponseSetFactory()
Expand Down
Loading