mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-30 11:19:44 -04:00
1423 - Few final updates to switch over to login.gov
This commit is contained in:
@@ -222,8 +222,7 @@ def test_if_existing_user_accepts_twice_they_redirect_to_sign_in(
|
||||
) == (
|
||||
"You need to sign in again",
|
||||
# TODO: Improve this given Login.gov configuration.
|
||||
# "We signed you out because you have not used Notify for a while.",
|
||||
"You have left to use Login.gov to sign in",
|
||||
"We signed you out because you have not used Notify for a while.",
|
||||
)
|
||||
# We don’t let people update `email_access_validated_at` using an
|
||||
# already-accepted invite
|
||||
@@ -338,8 +337,7 @@ def test_existing_user_of_service_get_redirected_to_signin(
|
||||
) == (
|
||||
"You need to sign in again",
|
||||
# TODO: Improve this given Login.gov configuration.
|
||||
# "We signed you out because you have not used Notify for a while.",
|
||||
"You have left to use Login.gov to sign in",
|
||||
"We signed you out because you have not used Notify for a while.",
|
||||
)
|
||||
assert mock_accept_invite.call_count == 1
|
||||
|
||||
@@ -429,8 +427,7 @@ def test_existing_signed_out_user_accept_invite_redirects_to_sign_in(
|
||||
) == (
|
||||
"You need to sign in again",
|
||||
# TODO: Improve this given Login.gov configuration.
|
||||
# "We signed you out because you have not used Notify for a while.",
|
||||
"You have left to use Login.gov to sign in",
|
||||
"We signed you out because you have not used Notify for a while.",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -12,40 +12,21 @@ def test_render_sign_in_template_for_new_user(client_request):
|
||||
client_request.logout()
|
||||
page = client_request.get("main.sign_in")
|
||||
assert normalize_spaces(page.select_one("h1").text) == "Sign in"
|
||||
assert normalize_spaces(page.select("label")[0].text) == "Email address"
|
||||
assert page.select_one("#email_address").get("value") is None
|
||||
assert page.select_one("#email_address")["autocomplete"] == "email"
|
||||
assert normalize_spaces(page.select("label")[1].text) == "Password"
|
||||
assert page.select_one("#password").get("value") is None
|
||||
assert page.select_one("#password")["autocomplete"] == "current-password"
|
||||
# Removing for the pilot
|
||||
# assert page.select('main a')[0].text == 'create one now'
|
||||
# assert page.select('main a')[0]['href'] == url_for('main.register')
|
||||
assert (
|
||||
page.select("main p")[0].text
|
||||
== "Access your Notify.gov account by signing in with Login.gov:"
|
||||
)
|
||||
# TODO: Fix this test to be less brittle! If the Login.gov link is enabled,
|
||||
# then these indices need to be 1 instead of 0.
|
||||
# Currently it's not enabled for the test or production environments.
|
||||
assert page.select("main a")[1].text == "Forgot your password?"
|
||||
assert page.select("main a")[1]["href"] == url_for("main.forgot_password")
|
||||
assert page.select("main a")[0].text == "Sign in with Login.gov"
|
||||
assert page.select("main a")[1].text == "Create Login.gov account"
|
||||
|
||||
# TODO: We'll have to adjust this depending on whether Login.gov is
|
||||
# enabled or not; fix this in the future.
|
||||
assert "Sign in again" not in normalize_spaces(page.text)
|
||||
|
||||
|
||||
def test_render_sign_in_template_with_next_link_for_password_reset(client_request):
|
||||
client_request.logout()
|
||||
page = client_request.get(
|
||||
"main.sign_in",
|
||||
_optional_args=f"?next=/services/{SERVICE_ONE_ID}/templates",
|
||||
_test_page_title=False,
|
||||
)
|
||||
forgot_password_link = page.find("a", class_="usa-link")
|
||||
assert forgot_password_link.text == "Forgot your password?"
|
||||
assert forgot_password_link["href"] == url_for(
|
||||
"main.forgot_password", next=f"/services/{SERVICE_ONE_ID}/templates"
|
||||
)
|
||||
|
||||
|
||||
def test_reformat_keystring():
|
||||
orig = "-----BEGIN PRIVATE KEY----- blah blah blah -----END PRIVATE KEY-----"
|
||||
expected = """-----BEGIN PRIVATE KEY-----
|
||||
|
||||
Reference in New Issue
Block a user