mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
Added back removed tests
This commit is contained in:
@@ -2,7 +2,64 @@ import os
|
||||
from functools import partial
|
||||
|
||||
import pytest
|
||||
from bs4 import BeautifulSoup
|
||||
from flask import url_for
|
||||
from freezegun import freeze_time
|
||||
|
||||
from tests.conftest import SERVICE_ONE_ID, normalize_spaces
|
||||
|
||||
def test_non_logged_in_user_can_see_homepage(
|
||||
client_request, mock_get_service_and_organization_counts, mocker
|
||||
):
|
||||
|
||||
mocker.patch("app.notify_client.user_api_client.UserApiClient.deactivate_user")
|
||||
client_request.logout()
|
||||
page = client_request.get("main.index", _test_page_title=False)
|
||||
|
||||
assert page.h1.text.strip() == (
|
||||
"Reach people where they are with government-powered text messages"
|
||||
)
|
||||
|
||||
assert (
|
||||
page.select_one(
|
||||
"a.usa-button.login-button.login-button--primary.margin-right-2"
|
||||
).text
|
||||
== "Sign in with \n"
|
||||
)
|
||||
assert page.select_one("meta[name=description]") is not None
|
||||
# This area is hidden for the pilot
|
||||
# assert normalize_spaces(page.select_one('#whos-using-notify').text) == (
|
||||
# 'Who’s using Notify.gov ' # Hiding this next area for the pilot
|
||||
# # Hiding this next area for the pilot
|
||||
# # 'See the list of services and organizations. '
|
||||
# 'There are 111 Organizations and 9,999 Services using Notify.'
|
||||
# )
|
||||
|
||||
assert page.select_one("#whos-using-notify a") is None
|
||||
|
||||
|
||||
def test_logged_in_user_redirects_to_choose_account(
|
||||
client_request,
|
||||
api_user_active,
|
||||
mock_get_user,
|
||||
mock_get_user_by_email,
|
||||
mock_login,
|
||||
):
|
||||
client_request.get(
|
||||
"main.index",
|
||||
_expected_status=302,
|
||||
)
|
||||
|
||||
# Modify expected URL to include the query parameter
|
||||
client_request.get(
|
||||
"main.sign_in",
|
||||
_expected_status=302,
|
||||
_expected_redirect=url_for("main.show_accounts_or_dashboard") + "?next=EMAIL_IS_OK",
|
||||
)
|
||||
|
||||
|
||||
def test_robots(client_request):
|
||||
client_request.get_url("/robots.txt", _expected_status=404)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
Reference in New Issue
Block a user