From 4e6b33be1c04c6e3503b111e1e92656bee18747e Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 22 Jan 2026 11:35:22 -0800 Subject: [PATCH] fix test --- app/commands.py | 5 ++++ tests/app/test_commands.py | 58 ++++++++++++++++++-------------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/app/commands.py b/app/commands.py index 86ac6cea6..53f32602c 100644 --- a/app/commands.py +++ b/app/commands.py @@ -262,6 +262,11 @@ def bulk_invite_user_to_service(file_name, service_id, user_id, auth_type, permi file.close() +# TODO this is commented out because there is a conflict between +# the version of wheel we need to be on (0.46.2 or greater) and +# the click-datetime dependency, which insists wheel be 0.45.0 or lower. +# So need to rewrite this command to not use click-datetime, or see +# if the owners of click-datetime updated it (not as of 1/22/2026). # @notify_command(name="archive-jobs-created-between-dates") # @click.option( # "-s", diff --git a/tests/app/test_commands.py b/tests/app/test_commands.py index 943597fa7..cdd9a0d94 100644 --- a/tests/app/test_commands.py +++ b/tests/app/test_commands.py @@ -7,7 +7,7 @@ import pytest from sqlalchemy import func, select from app import db -from app.commands import ( +from app.commands import ( # update_jobs_archived_flag, _clear_templates_from_cache, _update_template, associate_services_to_organizations, @@ -32,7 +32,6 @@ from app.commands import ( promote_user_to_platform_admin, purge_csv_bucket, purge_functional_test_data, - update_jobs_archived_flag, update_templates, ) from app.dao.inbound_numbers_dao import dao_get_available_inbound_numbers @@ -46,9 +45,8 @@ from app.enums import ( TemplateType, UserState, ) -from app.models import ( +from app.models import ( # Job, AnnualBilling, - Job, Notification, Organization, Service, @@ -56,13 +54,11 @@ from app.models import ( User, ) from app.utils import utc_now -from tests.app.db import ( +from tests.app.db import ( # create_job,; create_template, create_annual_billing, - create_job, create_notification, create_organization, create_service, - create_template, ) @@ -120,35 +116,35 @@ def test_purge_functional_test_data_bad_mobile(notify_db_session, notify_api): assert user_count == 0 -def test_update_jobs_archived_flag(notify_db_session, notify_api): - service = create_service() +# def test_update_jobs_archived_flag(notify_db_session, notify_api): +# service = create_service() - sms_template = create_template(service=service, template_type=TemplateType.SMS) - create_job(sms_template) +# sms_template = create_template(service=service, template_type=TemplateType.SMS) +# create_job(sms_template) - right_now = utc_now() - tomorrow = right_now + timedelta(days=1) +# right_now = utc_now() +# tomorrow = right_now + timedelta(days=1) - right_now = right_now.strftime("%Y-%m-%d") - tomorrow = tomorrow.strftime("%Y-%m-%d") +# right_now = right_now.strftime("%Y-%m-%d") +# tomorrow = tomorrow.strftime("%Y-%m-%d") - stmt = select(Job).where(Job.archived is True) - archived_jobs = db.session.execute(stmt).scalar() or 0 - assert archived_jobs == 0 +# stmt = select(Job).where(Job.archived is True) +# archived_jobs = db.session.execute(stmt).scalar() or 0 +# assert archived_jobs == 0 - notify_api.test_cli_runner().invoke( - update_jobs_archived_flag, - [ - "-e", - tomorrow, - "-s", - right_now, - ], - ) - jobs = db.session.execute(select(Job)).scalars().all() - assert len(jobs) == 1 - for job in jobs: - assert job.archived is True +# notify_api.test_cli_runner().invoke( +# update_jobs_archived_flag, +# [ +# "-e", +# tomorrow, +# "-s", +# right_now, +# ], +# ) +# jobs = db.session.execute(select(Job)).scalars().all() +# assert len(jobs) == 1 +# for job in jobs: +# assert job.archived is True def _get_organization_query_count():