Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LGA-3319: Add additional MI Scope Report tests for new notes format #1251

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 2 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
77 changes: 77 additions & 0 deletions cla_backend/apps/reports/tests/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,52 @@ def test_report_client_public_diagnosis_note(self):
}
self.assertDictContainsSubset(expected, dict(report[0]))

def test_report_client_new_frontend(self):
eligible_case = make_recipe("legalaid.eligible_case", source="WEB")
eligible_case.eligibility_check.notes = self.get_notes_new_frontend()
eligible_case.eligibility_check.save()

self.assertEqual(eligible_case.eligibility_check.state, "yes")
self.assertEqual(eligible_case.diagnosis.state, "INSCOPE")
self.assertEqual(eligible_case.source, "WEB")

report = self.get_report()
expected = {
"Web diagnosis category 1": "Discrimination",
"Web diagnosis category 2": "Work - including colleagues, employer or employment agency",
"Web diagnosis category 3": "Disability, health condition, mental health condition",
"Web diagnosis category 4": "",
"Web diagnosis category 5": "",
"Web diagnosis category 6": "",
"Web scope state": "INSCOPE",
"Client notes": "",
"Workflow status": "Operator",
}
self.assertDictContainsSubset(expected, dict(report[0]))

def test_report_client_new_frontend_public_diagnsosis_note(self):
eligible_case = make_recipe("legalaid.eligible_case", source="WEB")
eligible_case.eligibility_check.notes = self.get_notes_new_frontend_public_diagnsosis_note()
eligible_case.eligibility_check.save()

self.assertEqual(eligible_case.eligibility_check.state, "yes")
self.assertEqual(eligible_case.diagnosis.state, "CONTACT")
self.assertEqual(eligible_case.source, "WEB")

report = self.get_report()
expected = {
"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": "CONTACT",
"Client notes": "",
"Workflow status": "Operator",
}
self.assertDictContainsSubset(expected, dict(report[0]))

def test_report_workflow_status_pending(self):
eligible_case = make_recipe("legalaid.case", source="WEB")
self.assertEqual(eligible_case.source, "WEB")
Expand Down Expand Up @@ -737,3 +783,34 @@ def get_notes_public_diagnosis_note(self):

Outcome: CONTACT
"""

def get_notes_new_frontend(self):
return """User problem:
Optional data

User selected:
What do you need help with?: Discrimination

Where did the discrimination happen?: Work - including colleagues, employer or employment agency

Why were you treated differently?: Disability, health condition, mental health condition

Outcome: In Scope
"""

def get_notes_new_frontend_public_diagnsosis_note(self):
return """User problem:
Data

Public Diagnosis note:
User is at immediate risk of harm

User selected:
What do you need help with?: Domestic abuse

Domestic Abuse: Help to protect you and your children

Are you or your children at immediate risk of harm?: Yes

Outcome: In Scope - skip means test
"""
Loading