mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
delete commented out code
This commit is contained in:
@@ -632,137 +632,6 @@ def test_remove_user_folder_permissions(admin_request, sample_user, sample_servi
|
||||
assert service_user.folders == []
|
||||
|
||||
|
||||
# @freeze_time("2016-01-01 11:09:00.061258")
|
||||
# def test_send_user_reset_password_should_send_reset_password_link(
|
||||
# admin_request, sample_user, mocker, password_reset_email_template
|
||||
# ):
|
||||
# mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
||||
# data = {"email": sample_user.email_address}
|
||||
# notify_service = password_reset_email_template.service
|
||||
|
||||
# admin_request.post(
|
||||
# "user.send_user_reset_password",
|
||||
# _data=data,
|
||||
# _expected_status=204,
|
||||
# )
|
||||
|
||||
# notification = Notification.query.first()
|
||||
# mocked.assert_called_once_with(
|
||||
# [str(notification.id)], queue="notify-internal-tasks"
|
||||
# )
|
||||
# assert (
|
||||
# notification.reply_to_text
|
||||
# == notify_service.get_default_reply_to_email_address()
|
||||
# )
|
||||
|
||||
|
||||
# @pytest.mark.parametrize(
|
||||
# "data, expected_url",
|
||||
# (
|
||||
# (
|
||||
# {
|
||||
# "email": "notify@digital.fake.gov",
|
||||
# },
|
||||
# ("http://localhost:6012/new-password/"),
|
||||
# ),
|
||||
# (
|
||||
# {
|
||||
# "email": "notify@digital.fake.gov",
|
||||
# "admin_base_url": "https://different.example.com",
|
||||
# },
|
||||
# ("https://different.example.com/new-password/"),
|
||||
# ),
|
||||
# ),
|
||||
# )
|
||||
# @freeze_time("2016-01-01 11:09:00.061258")
|
||||
# def test_send_user_reset_password_should_use_provided_base_url(
|
||||
# admin_request,
|
||||
# sample_user,
|
||||
# password_reset_email_template,
|
||||
# mocker,
|
||||
# data,
|
||||
# expected_url,
|
||||
# ):
|
||||
# mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
||||
|
||||
# admin_request.post(
|
||||
# "user.send_user_reset_password",
|
||||
# _data=data,
|
||||
# _expected_status=204,
|
||||
# )
|
||||
|
||||
# assert Notification.query.first().personalisation["url"].startswith(expected_url)
|
||||
|
||||
|
||||
# @freeze_time("2016-01-01 11:09:00.061258")
|
||||
# def test_send_user_reset_password_reset_password_link_contains_redirect_link_if_present_in_request(
|
||||
# admin_request, sample_user, mocker, password_reset_email_template
|
||||
# ):
|
||||
# mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
||||
# data = {"email": sample_user.email_address, "next": "blob"}
|
||||
|
||||
# admin_request.post(
|
||||
# "user.send_user_reset_password",
|
||||
# _data=data,
|
||||
# _expected_status=204,
|
||||
# )
|
||||
|
||||
# notification = Notification.query.first()
|
||||
# assert "?next=blob" in notification.content
|
||||
# mocked.assert_called_once_with(
|
||||
# [str(notification.id)], queue="notify-internal-tasks"
|
||||
# )
|
||||
|
||||
|
||||
# def test_send_user_reset_password_should_return_400_when_email_is_missing(
|
||||
# admin_request, mocker
|
||||
# ):
|
||||
# mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
||||
# data = {}
|
||||
|
||||
# json_resp = admin_request.post(
|
||||
# "user.send_user_reset_password",
|
||||
# _data=data,
|
||||
# _expected_status=400,
|
||||
# )
|
||||
# assert json_resp["message"] == {"email": ["Missing data for required field."]}
|
||||
# assert mocked.call_count == 0
|
||||
|
||||
|
||||
# def test_send_user_reset_password_should_return_400_when_user_doesnot_exist(
|
||||
# admin_request, mocker
|
||||
# ):
|
||||
# mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
||||
# bad_email_address = "bad@email.gov.uk"
|
||||
# data = {"email": bad_email_address}
|
||||
|
||||
# json_resp = admin_request.post(
|
||||
# "user.send_user_reset_password",
|
||||
# _data=data,
|
||||
# _expected_status=404,
|
||||
# )
|
||||
|
||||
# assert json_resp["message"] == "No result found"
|
||||
# assert mocked.call_count == 0
|
||||
|
||||
|
||||
# def test_send_user_reset_password_should_return_400_when_data_is_not_email_address(
|
||||
# admin_request, mocker
|
||||
# ):
|
||||
# mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async")
|
||||
# bad_email_address = "bad.email.gov.uk"
|
||||
# data = {"email": bad_email_address}
|
||||
|
||||
# json_resp = admin_request.post(
|
||||
# "user.send_user_reset_password",
|
||||
# _data=data,
|
||||
# _expected_status=400,
|
||||
# )
|
||||
|
||||
# assert json_resp["message"] == {"email": ["Not a valid email address"]}
|
||||
# assert mocked.call_count == 0
|
||||
|
||||
|
||||
def test_send_already_registered_email(
|
||||
admin_request, sample_user, already_registered_template, mocker
|
||||
):
|
||||
@@ -842,27 +711,6 @@ def test_send_user_confirm_new_email_returns_400_when_email_missing(
|
||||
mocked.assert_not_called()
|
||||
|
||||
|
||||
# @freeze_time("2020-02-14T12:00:00")
|
||||
# def test_update_user_password_saves_correctly(admin_request, sample_service):
|
||||
# sample_user = sample_service.users[0]
|
||||
# new_password = "1234567890"
|
||||
# data = {"_password": "1234567890"}
|
||||
|
||||
# json_resp = admin_request.post(
|
||||
# "user.update_password", user_id=str(sample_user.id), _data=data
|
||||
# )
|
||||
|
||||
# assert json_resp["data"]["password_changed_at"] is not None
|
||||
# data = {"password": new_password}
|
||||
|
||||
# admin_request.post(
|
||||
# "user.verify_user_password",
|
||||
# user_id=str(sample_user.id),
|
||||
# _data=data,
|
||||
# _expected_status=204,
|
||||
# )
|
||||
|
||||
|
||||
def test_activate_user(admin_request, sample_user):
|
||||
sample_user.state = "pending"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user