fixed testing

This commit is contained in:
Beverly Nguyen
2024-10-21 10:27:35 -07:00
parent 088c2244a3
commit 7775508c97
8 changed files with 40 additions and 12 deletions

View File

@@ -52,7 +52,10 @@ def test_logged_in_user_redirects_to_choose_account(
client_request.get(
"main.sign_in",
_expected_status=302,
_expected_redirect=url_for("main.show_accounts_or_dashboard"),
_expected_redirect=url_for(
"main.show_accounts_or_dashboard",
next="EMAIL_IS_OK",
),
)
@@ -91,6 +94,7 @@ def test_hiding_pages_from_search_engines(
"roadmap",
"features",
"documentation",
"guidance",
"security",
"message_status",
"features_sms",
@@ -127,6 +131,28 @@ def test_static_pages(client_request, mock_get_organization_by_domain, view, moc
)
@pytest.mark.parametrize(
"endpoint, template",
[
("main.guidance", "views/guidance/guidance.html"),
("main.clear_goals", "views/guidance/clear-goals.html"),
("main.rules_and_regulations", "views/guidance/rules-and-regulations.html"),
("main.establish_trust", "views/guidance/establish-trust.html"),
("main.write_for_action", "views/guidance/write-for-action.html"),
("main.multiple_languages", "views/guidance/multiple-languages.html"),
("main.benchmark_performance", "views/guidance/benchmark-performance.html"),
]
)
def test_guidance_routes(client_request, endpoint, template):
# Make the request to the endpoint
page = client_request.get(endpoint)
# Assert that the page loads successfully (HTTP 200 OK)
assert page.status_code == 200
def test_guidance_pages_link_to_service_pages_when_signed_in(client_request, mocker):
mocker.patch("app.notify_client.user_api_client.UserApiClient.deactivate_user")