Skip to content

Commit

Permalink
Fix error message and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petechd committed Jun 13, 2024
1 parent 1a93a79 commit 6451607
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/validators/questionnaire_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def validate_list_references(self):
error_messages.LIST_REFERENCED_BEFORE_ADDED.format(),
list_id=list_identifier,
section_id=section["id"],
parent_block_id=parent_block["id"],
block_id=parent_block["id"],
)
elif (
section_index
Expand Down
34 changes: 17 additions & 17 deletions tests/test_questionnaire_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,49 +415,49 @@ def test_list_as_source_referenced_before_created():
expected_errors = [
{
"list_id": "household",
"message": "List referenced as source before it has been created.",
"parent_block_id": "individual-interstitial",
"message": error_messages.LIST_REFERENCED_BEFORE_ADDED,
"block_id": "individual-interstitial",
"section_id": "individuals-section",
},
{
"list_id": "household",
"message": "List referenced as source before it has been created.",
"parent_block_id": "individual-interstitial",
"message": error_messages.LIST_REFERENCED_BEFORE_ADDED,
"block_id": "individual-interstitial",
"section_id": "individuals-section",
},
{
"list_id": "household",
"message": "List referenced as source before it has been created.",
"parent_block_id": "list-status-2",
"message": error_messages.LIST_REFERENCED_BEFORE_ADDED,
"block_id": "list-status-2",
"section_id": "individuals-section",
},
{
"list_id": "household",
"message": "List referenced as source before it has been created.",
"parent_block_id": "list-status-2",
"message": error_messages.LIST_REFERENCED_BEFORE_ADDED,
"block_id": "list-status-2",
"section_id": "individuals-section",
},
{
"list_id": "household",
"message": "List referenced as source before it has been created.",
"parent_block_id": "list-status-2",
"message": error_messages.LIST_REFERENCED_BEFORE_ADDED,
"block_id": "list-status-2",
"section_id": "individuals-section",
},
{
"list_name": "household",
"message": "List referenced as source before it has been created.",
"message": error_messages.LIST_REFERENCED_BEFORE_ADDED,
"section_id": "individuals-section",
},
{
"list_id": "utility-bills",
"message": "List referenced as source before it has been created.",
"parent_block_id": "dynamic-answer",
"message": error_messages.LIST_REFERENCED_BEFORE_ADDED,
"block_id": "dynamic-answer",
"section_id": "utility-bills-section",
},
{
"list_id": "utility-bills",
"message": "List referenced as source before it has been created.",
"parent_block_id": "dynamic-answer",
"message": error_messages.LIST_REFERENCED_BEFORE_ADDED,
"block_id": "dynamic-answer",
"section_id": "utility-bills-section",
},
]
Expand All @@ -476,8 +476,8 @@ def test_list_as_source_referenced_before_created_repeating_blocks():
expected_errors = [
{
"list_id": "companies",
"message": "List referenced as source before it has been created.",
"parent_block_id": "any-other-companies-or-branches",
"message": error_messages.LIST_REFERENCED_BEFORE_ADDED,
"block_id": "any-other-companies-or-branches",
"section_id": "section-companies",
}
]
Expand Down

0 comments on commit 6451607

Please sign in to comment.