Skip to content

Commit

Permalink
Fix MI Scope Report to accept spaces in the scope output
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMillar-MOJ committed Nov 6, 2024
1 parent fd3265b commit 992408a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cla_backend/apps/reports/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ def _get_col_index(self, column_name):
def notes_to_dict(notes):
def get_categories_and_scope(user_selected_text):
items, scope = user_selected_text.split("Outcome: ")
scope = re.sub(r"\s+|\n", "", scope)
scope = re.sub(r"\s+", " ", scope).strip()
categories = []
for category in items.split("\n\n"):
if ": " in category:
Expand Down
6 changes: 3 additions & 3 deletions cla_backend/apps/reports/tests/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def test_report_client_new_frontend(self):
"Web diagnosis category 4": "",
"Web diagnosis category 5": "",
"Web diagnosis category 6": "",
"Web scope state": "InScope",
"Web scope state": "In Scope",
"Client notes": "Optional data\n\n",
"Workflow status": "Operator",
}
Expand All @@ -676,13 +676,13 @@ def test_report_client_new_frontend_public_diagnsosis_note(self):

report = self.get_report()
expected = {
"Web diagnosis category 1": "Domestic Abuse",
"Web diagnosis category 1": "Domestic abuse",
"Web diagnosis category 2": "Help to protect you and your children",
"Web diagnosis category 3": "Yes",
"Web diagnosis category 4": "",
"Web diagnosis category 5": "",
"Web diagnosis category 6": "",
"Web scope state": "InScope - Skip means test",
"Web scope state": "In Scope - Skip means test",
"Client notes": "Data\n\n",
"Workflow status": "Operator",
}
Expand Down

0 comments on commit 992408a

Please sign in to comment.