generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
207 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from flask import Blueprint | ||
|
||
bp = Blueprint( | ||
"more_problems", | ||
__name__, | ||
template_folder="./templates", | ||
) | ||
|
||
from app.categories.more_problems import urls # noqa: E402,F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
MORE_PROBLEMS = [ | ||
{ | ||
"heading": "Adopting a child from outside the UK", | ||
"description": "Adoption processes in the courts.", | ||
"next_page": "find-a-legal-adviser.search", | ||
"category": "mat", | ||
}, | ||
{ | ||
"heading": "Appeal a decision that you cannot work with children or vulnerable adults", | ||
"description": "Including if you’re on a ‘barred list’ or disqualified from teaching.", | ||
"next_page": "find-a-legal-adviser.search", | ||
}, | ||
{ | ||
"heading": "Anti-social behaviour and gangs", | ||
"description": "If you’re accused or taken to court for anti-social behaviour, including being in a gang.", | ||
"next_page": "categories.x_cat.landlord-council", | ||
}, | ||
{ | ||
"heading": "Clinical negligence in babies", | ||
"description": "Help if a baby has brain or nerve damage caused during pregnancy, childbirth or up to 8 weeks old.", | ||
"next_page": "find-a-legal-adviser.search", | ||
"category": "med", | ||
}, | ||
{ | ||
"heading": "Compensation for abuse, assault or neglect", | ||
"description": "Includes child abuse, sexual assault, abuse of a vulnerable adult. Claims can be against a person or an organisation.", | ||
"next_page": "find-a-legal-adviser.search", | ||
"category": "aap", | ||
}, | ||
{ | ||
"heading": "Domestic abuse - if you have been accused", | ||
"description": "Legal help if you’ve been accused of domestic abuse or forced marriage. Includes non-molestation orders and other court orders.", | ||
"next_page": "categories.results.in_scope", | ||
}, | ||
{ | ||
"heading": "Environmental pollution", | ||
"description": "Issues about air, water or land pollution that is harming you or the environment.", | ||
"next_page": "find-a-legal-adviser.search", | ||
"category": "pub", | ||
}, | ||
{ | ||
"heading": "Female genital mutilation (FGM)", | ||
"description": "If you or someone else is at risk of FGM.", | ||
"next_page": "categories.domestic_abuse.are_you_at_risk_of_harm", | ||
}, | ||
{ | ||
"heading": "Forced marriage", | ||
"description": "Help with forced marriage and Forced Marriage Protection Orders.", | ||
"next_page": "categories.domestic_abuse.are_you_at_risk_of_harm", | ||
}, | ||
{ | ||
"heading": "Inquests for family members", | ||
"description": "Advice to prepare for the inquest of a family member.", | ||
"next_page": "find-a-legal-adviser.search", | ||
}, | ||
{ | ||
"heading": "Mental health detention", | ||
"description": "Help if you’re held in hospital (‘sectioned’), mental health tribunals and community treatment orders.", | ||
"next_page": "find-a-legal-adviser.search", | ||
"category": "mhe", | ||
}, | ||
{ | ||
"heading": "Proceeds of Crime Act", | ||
"description": "If you’re facing legal action to take your money or other assets.", | ||
"next_page": "find-a-legal-adviser.search", | ||
"category": "crm", | ||
}, | ||
{ | ||
"heading": "Terrorism", | ||
"description": "If you’re accused of terrorism or financing terrorist groups.", | ||
"next_page": "find-a-legal-adviser.search", | ||
"category": "immas", | ||
"secondary_category": "pub", | ||
}, | ||
{ | ||
"heading": "Trafficking, modern slavery", | ||
"description": "Help if you’re a victim of human trafficking or modern slavery.", | ||
"next_page": "find-a-legal-adviser.search", | ||
"category": "immas", | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from flask import render_template | ||
from app.categories.more_problems import bp | ||
from app.categories.views import CategoryPage | ||
from app.categories.results.views import CannotFindYourProblemPage, NextStepsPage | ||
from app.categories.more_problems.constants import MORE_PROBLEMS | ||
|
||
|
||
class MoreProblemsPage(CategoryPage): | ||
template = "categories/more-problems.html" | ||
|
||
def dispatch_request(self): | ||
listing = MORE_PROBLEMS | ||
return render_template(self.template, listing=listing) | ||
|
||
|
||
bp.add_url_rule( | ||
"/more-problems", | ||
view_func=MoreProblemsPage.as_view( | ||
"landing", template="categories/more-problems.html" | ||
), | ||
) | ||
bp.add_url_rule( | ||
"/more-problems/cannot-find-your-problem", | ||
view_func=CannotFindYourProblemPage.as_view( | ||
"cannot_find_your_problem", | ||
next_steps_page="categories.more_problems.next_steps", | ||
), | ||
) | ||
bp.add_url_rule( | ||
"/more-problems/next-steps", | ||
view_func=NextStepsPage.as_view( | ||
"next_steps", | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
tests/functional_tests/categories/test_clinical_negilgence.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
from playwright.sync_api import Page, expect | ||
import pytest | ||
|
||
|
||
@pytest.mark.usefixtures("live_server") | ||
@pytest.mark.parametrize( | ||
"category_name, expected_heading", | ||
[ | ||
pytest.param( | ||
"Adopting a child from outside the UK", | ||
"Find a legal adviser", | ||
), | ||
pytest.param( | ||
"Appeal a decision that you cannot work with children or vulnerable adults", | ||
"Find a legal adviser", | ||
), | ||
pytest.param( | ||
"Anti-social behaviour and gangs", | ||
"Were you accused by a landlord or the council?", | ||
), | ||
pytest.param( | ||
"Clinical negligence in babies", | ||
"Find a legal adviser", | ||
), | ||
pytest.param( | ||
"Compensation for abuse, assault or neglect", | ||
"Find a legal adviser", | ||
), | ||
pytest.param( | ||
"Domestic abuse - if you have been accused", | ||
"Legal aid is available for this type of problem", | ||
), | ||
pytest.param( | ||
"Environmental pollution", | ||
"Find a legal adviser", | ||
), | ||
pytest.param( | ||
"Female genital mutilation (FGM)", | ||
"Are you worried about someone's safety?", | ||
), | ||
pytest.param( | ||
"Forced marriage", | ||
"Are you worried about someone's safety?", | ||
), | ||
pytest.param( | ||
"Inquests for family members", | ||
"Find a legal adviser", | ||
), | ||
pytest.param( | ||
"Mental health detention", | ||
"Find a legal adviser", | ||
), | ||
pytest.param( | ||
"Proceeds of Crime Act", | ||
"Find a legal adviser", | ||
), | ||
pytest.param( | ||
"Terrorism", | ||
"Find a legal adviser", | ||
), | ||
pytest.param( | ||
"Trafficking, modern slavery", | ||
"Find a legal adviser", | ||
), | ||
pytest.param( | ||
"Next steps to get help", | ||
"Sorry, you’re not likely to get legal aid", | ||
), | ||
], | ||
) | ||
def test_more_problems(page: Page, category_name: str, expected_heading: str): | ||
page.get_by_role("link", name="More problems covered by legal aid").click() | ||
page.get_by_role("link", name=category_name).click() | ||
expect(page.get_by_role("heading", name=expected_heading)).to_be_visible() |