mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
@@ -536,10 +536,7 @@ def test_get_all_notifications_for_job_by_status(sample_job):
|
||||
|
||||
assert len(notifications(filter_dict={"status": status}).items) == 1
|
||||
|
||||
assert (
|
||||
len(notifications(filter_dict={"status": NotificationStatus[:3]}).items)
|
||||
== 3
|
||||
)
|
||||
assert len(notifications(filter_dict={"status": NotificationStatus[:3]}).items) == 3
|
||||
|
||||
|
||||
def test_dao_get_notification_count_for_job_id(notify_db_session):
|
||||
|
||||
@@ -8,10 +8,7 @@ from app.dao.notifications_dao import (
|
||||
move_notifications_to_notification_history,
|
||||
)
|
||||
from app.enums import KeyType
|
||||
from app.models import (
|
||||
Notification,
|
||||
NotificationHistory,
|
||||
)
|
||||
from app.models import Notification, NotificationHistory
|
||||
from tests.app.db import (
|
||||
create_notification,
|
||||
create_notification_history,
|
||||
|
||||
@@ -18,11 +18,7 @@ from app.dao.fact_notification_status_dao import (
|
||||
update_fact_notification_status,
|
||||
)
|
||||
from app.enums import KeyType, NotificationStatus
|
||||
from app.models import (
|
||||
FactNotificationStatus,
|
||||
NotificationType,
|
||||
TemplateType,
|
||||
)
|
||||
from app.models import FactNotificationStatus, NotificationType, TemplateType
|
||||
from tests.app.db import (
|
||||
create_ft_notification_status,
|
||||
create_job,
|
||||
|
||||
@@ -123,11 +123,21 @@ 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.filter(InvitedUser.status != InvitedUserStatus.EXPIRED).all()) == 2
|
||||
len(
|
||||
InvitedUser.query.filter(
|
||||
InvitedUser.status != InvitedUserStatus.EXPIRED
|
||||
).all()
|
||||
)
|
||||
== 2
|
||||
)
|
||||
expire_invitations_created_more_than_two_days_ago()
|
||||
assert (
|
||||
len(InvitedUser.query.filter(InvitedUser.status != InvitedUserStatus.EXPIRED).all()) == 0
|
||||
len(
|
||||
InvitedUser.query.filter(
|
||||
InvitedUser.status != InvitedUserStatus.EXPIRED
|
||||
).all()
|
||||
)
|
||||
== 0
|
||||
)
|
||||
|
||||
|
||||
@@ -150,11 +160,21 @@ def test_should_not_delete_invitations_less_than_two_days_old(
|
||||
)
|
||||
|
||||
assert (
|
||||
len(InvitedUser.query.filter(InvitedUser.status != InvitedUserStatus.EXPIRED).all()) == 2
|
||||
len(
|
||||
InvitedUser.query.filter(
|
||||
InvitedUser.status != InvitedUserStatus.EXPIRED
|
||||
).all()
|
||||
)
|
||||
== 2
|
||||
)
|
||||
expire_invitations_created_more_than_two_days_ago()
|
||||
assert (
|
||||
len(InvitedUser.query.filter(InvitedUser.status != InvitedUserStatus.EXPIRED).all()) == 1
|
||||
len(
|
||||
InvitedUser.query.filter(
|
||||
InvitedUser.status != InvitedUserStatus.EXPIRED
|
||||
).all()
|
||||
)
|
||||
== 1
|
||||
)
|
||||
assert (
|
||||
InvitedUser.query.filter(InvitedUser.status != InvitedUserStatus.EXPIRED)
|
||||
|
||||
Reference in New Issue
Block a user