Skip to content

Commit

Permalink
Reuse field names in milestone dates form error tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markhobson committed Jan 17, 2025
1 parent 1b0a32e commit 4d532bb
Showing 1 changed file with 30 additions and 24 deletions.
54 changes: 30 additions & 24 deletions tests/views/schemes/test_milestones.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,18 +362,21 @@ def test_date_without_initial_value_is_optional(self, field_name: str) -> None:

@pytest.mark.parametrize(
"field_name, expected_error",
[
("feasibility_design_completed_planned", "Enter a feasibility design completed planned date"),
("feasibility_design_completed_actual", "Enter a feasibility design completed actual date"),
("preliminary_design_completed_planned", "Enter a preliminary design completed planned date"),
("preliminary_design_completed_actual", "Enter a preliminary design completed actual date"),
("detailed_design_completed_planned", "Enter a detailed design completed planned date"),
("detailed_design_completed_actual", "Enter a detailed design completed actual date"),
("construction_started_planned", "Enter a construction started planned date"),
("construction_started_actual", "Enter a construction started actual date"),
("construction_completed_planned", "Enter a construction completed planned date"),
("construction_completed_actual", "Enter a construction completed actual date"),
],
zip(
field_names,
[
"Enter a feasibility design completed planned date",
"Enter a feasibility design completed actual date",
"Enter a preliminary design completed planned date",
"Enter a preliminary design completed actual date",
"Enter a detailed design completed planned date",
"Enter a detailed design completed actual date",
"Enter a construction started planned date",
"Enter a construction started actual date",
"Enter a construction completed planned date",
"Enter a construction completed actual date",
],
),
)
@pytest.mark.parametrize(
"date_",
Expand All @@ -399,18 +402,21 @@ def test_date_with_initial_value_is_required(

@pytest.mark.parametrize(
"field_name, expected_error",
[
("feasibility_design_completed_planned", "Feasibility design completed planned date must be a real date"),
("feasibility_design_completed_actual", "Feasibility design completed actual date must be a real date"),
("preliminary_design_completed_planned", "Preliminary design completed planned date must be a real date"),
("preliminary_design_completed_actual", "Preliminary design completed actual date must be a real date"),
("detailed_design_completed_planned", "Detailed design completed planned date must be a real date"),
("detailed_design_completed_actual", "Detailed design completed actual date must be a real date"),
("construction_started_planned", "Construction started planned date must be a real date"),
("construction_started_actual", "Construction started actual date must be a real date"),
("construction_completed_planned", "Construction completed planned date must be a real date"),
("construction_completed_actual", "Construction completed actual date must be a real date"),
],
zip(
field_names,
[
"Feasibility design completed planned date must be a real date",
"Feasibility design completed actual date must be a real date",
"Preliminary design completed planned date must be a real date",
"Preliminary design completed actual date must be a real date",
"Detailed design completed planned date must be a real date",
"Detailed design completed actual date must be a real date",
"Construction started planned date must be a real date",
"Construction started actual date must be a real date",
"Construction completed planned date must be a real date",
"Construction completed actual date must be a real date",
],
),
)
@pytest.mark.parametrize(
"date_",
Expand Down

0 comments on commit 4d532bb

Please sign in to comment.