mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
fix test
This commit is contained in:
@@ -694,20 +694,14 @@ def test_get_all_notifications_for_job(sample_job):
|
||||
|
||||
|
||||
def test_get_recent_notifications_for_job(sample_job):
|
||||
for x in range(0, 5):
|
||||
try:
|
||||
n = create_notification(template=sample_job.template, job=sample_job)
|
||||
if x == 0:
|
||||
n.status = NotificationStatus.DELIVERED
|
||||
elif x in [1, 2]:
|
||||
n.status = NotificationStatus.FAILED
|
||||
except IntegrityError:
|
||||
pass
|
||||
|
||||
for status in NotificationStatus:
|
||||
create_notification(template=sample_job.template, job=sample_job, status=status)
|
||||
|
||||
notifications_from_db = get_recent_notifications_for_job(
|
||||
sample_job.service.id, sample_job.id
|
||||
).items
|
||||
assert len(notifications_from_db) == 3
|
||||
assert len(notifications_from_db) == 2
|
||||
print(notifications_from_db)
|
||||
|
||||
|
||||
|
||||
@@ -503,6 +503,11 @@ def test_get_recent_notifications_for_job_in_reverse_order_of_job_number(
|
||||
notification_1 = create_notification(job=main_job, to_field="1", job_row_number=1)
|
||||
notification_2 = create_notification(job=main_job, to_field="2", job_row_number=2)
|
||||
notification_3 = create_notification(job=main_job, to_field="3", job_row_number=3)
|
||||
|
||||
count = 1
|
||||
for status in NotificationStatus:
|
||||
create_notification(job=main_job, to_field=str(count), status=status)
|
||||
count = count + 1
|
||||
create_notification(job=another_job)
|
||||
|
||||
resp = admin_request.get(
|
||||
|
||||
Reference in New Issue
Block a user