mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 15:15:38 -05:00
Working on getting expiration implemented.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
@@ -11,7 +11,7 @@ from app.celery.scheduled_tasks import (
|
||||
check_for_missing_rows_in_completed_jobs,
|
||||
check_for_services_with_high_failure_rates_or_sending_to_tv_numbers,
|
||||
check_job_status,
|
||||
delete_invitations,
|
||||
expire_or_delete_invitations,
|
||||
delete_verify_codes,
|
||||
replay_created_notifications,
|
||||
run_scheduled_jobs,
|
||||
@@ -44,11 +44,11 @@ def test_should_call_delete_invotations_on_delete_invitations_task(
|
||||
notify_db_session, mocker
|
||||
):
|
||||
mocker.patch(
|
||||
"app.celery.scheduled_tasks.delete_invitations_created_more_than_two_days_ago"
|
||||
"app.celery.scheduled_tasks.expire_invitations_created_more_than_two_days_ago"
|
||||
)
|
||||
delete_invitations()
|
||||
expire_or_delete_invitations()
|
||||
assert (
|
||||
scheduled_tasks.delete_invitations_created_more_than_two_days_ago.call_count
|
||||
scheduled_tasks.expire_invitations_created_more_than_two_days_ago.call_count
|
||||
== 1
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from sqlalchemy.orm.exc import NoResultFound
|
||||
|
||||
from app import db
|
||||
from app.dao.invited_user_dao import (
|
||||
delete_invitations_created_more_than_two_days_ago,
|
||||
expire_invitations_created_more_than_two_days_ago,
|
||||
get_invited_user_by_id,
|
||||
get_invited_user_by_service_and_id,
|
||||
get_invited_users_for_service,
|
||||
@@ -122,7 +122,7 @@ def test_should_delete_all_invitations_more_than_one_day_old(
|
||||
make_invitation(sample_user, sample_service, age=timedelta(hours=48))
|
||||
make_invitation(sample_user, sample_service, age=timedelta(hours=48))
|
||||
assert len(InvitedUser.query.all()) == 2
|
||||
delete_invitations_created_more_than_two_days_ago()
|
||||
expire_invitations_created_more_than_two_days_ago()
|
||||
assert len(InvitedUser.query.all()) == 0
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ def test_should_not_delete_invitations_less_than_two_days_old(
|
||||
)
|
||||
|
||||
assert len(InvitedUser.query.all()) == 2
|
||||
delete_invitations_created_more_than_two_days_ago()
|
||||
expire_invitations_created_more_than_two_days_ago()
|
||||
assert len(InvitedUser.query.all()) == 1
|
||||
assert InvitedUser.query.first().email_address == "valid@2.com"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user