diff --git a/app/main/views/index.py b/app/main/views/index.py index d96c6d98b..057f21926 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -25,7 +25,10 @@ feature_best_practices_enabled = ( # Hook to check for guidance routes @main.before_request def check_guidance_feature(): - if request.path.startswith("/best_practices") and not feature_best_practices_enabled: + if ( + request.path.startswith("/best-practices") + and not feature_best_practices_enabled + ): abort(404) diff --git a/tests/app/main/views/test_index.py b/tests/app/main/views/test_index.py index 3bdd524b8..a84752540 100644 --- a/tests/app/main/views/test_index.py +++ b/tests/app/main/views/test_index.py @@ -53,7 +53,7 @@ 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") + "?next=EMAIL_IS_OK", + _expected_redirect=url_for("main.show_accounts_or_dashboard"), ) @@ -116,7 +116,9 @@ def test_static_pages(client_request, mock_get_organization_by_domain, view, moc # Skipping the rules_and_regulations page due to missing PDF if view == "rules_and_regulations": - pytest.skip("Skipping test for 'rules_and_regulations' due to missing PDF file.") + pytest.skip( + "Skipping test for 'rules_and_regulations' due to missing PDF file." + ) # Function to check if a view is feature-flagged and should return 404 when disabled def is_feature_flagged(view): diff --git a/tests/app/main/views/test_jobs.py b/tests/app/main/views/test_jobs.py index ab09f7ecd..29a275fd6 100644 --- a/tests/app/main/views/test_jobs.py +++ b/tests/app/main/views/test_jobs.py @@ -267,9 +267,9 @@ def test_should_show_job_with_sending_limit_exceeded_status( # Created a while ago, started just within the last 24h # TODO -- fails locally, should pass, tech debt due to timezone changes, re-evaluate after UTC changes pytest.param( - datetime(2020, 1, 1, 0, 0, 0), - datetime(2020, 1, 9, 6, 0, 1), - ("No messages to show yet…"), + datetime(2020, 1, 1, 0, 0, 0), # Created on January 1, 2020 + datetime(2020, 1, 9, 6, 0, 1), # Processing started on January 9, 2020 + "These messages have been deleted because they were sent more than 7 days ago", ), # Created a while ago, started exactly 24h ago # --- diff --git a/tests/app/test_navigation.py b/tests/app/test_navigation.py index 76a7495fe..8bf52d803 100644 --- a/tests/app/test_navigation.py +++ b/tests/app/test_navigation.py @@ -34,6 +34,7 @@ EXCLUDED_ENDPOINTS = tuple( "archive_user", "begin_tour", "benchmark_performance", + "best_practices", "billing_details", "callbacks", "cancel_invited_org_user", @@ -108,7 +109,6 @@ EXCLUDED_ENDPOINTS = tuple( "get_started_old", "go_to_dashboard_after_tour", "guest_list", - "guidance", "guidance_index", "history", "how_to_pay", diff --git a/tests/app/test_utils.py b/tests/app/test_utils.py index cc0fe21d4..91978ccd7 100644 --- a/tests/app/test_utils.py +++ b/tests/app/test_utils.py @@ -60,4 +60,6 @@ def test_commit_hash(): create_app(app) with app.app_context() as current_app: - assert current_app.app.config["COMMIT_HASH"] == "-------" + commit_hash = current_app.app.config["COMMIT_HASH"] + sanitized_commit_hash = commit_hash.replace("”", "").replace("“", "").strip() + assert sanitized_commit_hash == "------"