Skip to content

Commit

Permalink
tweak test
Browse files Browse the repository at this point in the history
  • Loading branch information
sastels committed Mar 19, 2024
1 parent fe1d622 commit 4a2b93f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/app/dao/test_jobs_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,20 +351,20 @@ def test_should_get_jobs_seven_days_old_by_scheduled_for_date(sample_service):

@freeze_time("2016-10-31 10:00:00")
def test_should_get_limited_number_of_jobs(sample_template):
flexable_retention_service1 = create_service(service_name="Another service 1")
insert_service_data_retention(flexable_retention_service1.id, sample_template.template_type, 3)
flexable_template1 = create_template(flexable_retention_service1, template_type=sample_template.template_type)
flexible_retention_service1 = create_service(service_name="Another service 1")
insert_service_data_retention(flexible_retention_service1.id, sample_template.template_type, 3)
flexible_template1 = create_template(flexible_retention_service1, template_type=sample_template.template_type)

flexable_retention_service2 = create_service(service_name="Another service 2")
insert_service_data_retention(flexable_retention_service2.id, sample_template.template_type, 3)
flexable_template2 = create_template(flexable_retention_service2, template_type=sample_template.template_type)
flexible_retention_service2 = create_service(service_name="Another service 2")
insert_service_data_retention(flexible_retention_service2.id, sample_template.template_type, 2)
flexible_template2 = create_template(flexible_retention_service2, template_type=sample_template.template_type)

eight_days_ago = datetime.utcnow() - timedelta(days=8)
four_days_ago = datetime.utcnow() - timedelta(days=4)

for _ in range(4):
create_job(flexable_template1, created_at=four_days_ago)
create_job(flexable_template2, created_at=four_days_ago)
create_job(flexible_template1, created_at=four_days_ago)
create_job(flexible_template2, created_at=four_days_ago)
create_job(sample_template, created_at=eight_days_ago)

jobs = dao_get_jobs_older_than_data_retention(notification_types=[sample_template.template_type], limit=3)
Expand Down

0 comments on commit 4a2b93f

Please sign in to comment.