remove the multiple workers from the tests

This commit is contained in:
Kenneth Kehl
2023-08-11 15:02:34 -07:00
parent 5c7cfb7b9e
commit f94b0bfc59

View File

@@ -1,3 +1,5 @@
import datetime
import pytest import pytest
from app.commands import ( from app.commands import (
@@ -8,13 +10,16 @@ from app.commands import (
populate_annual_billing_with_defaults, populate_annual_billing_with_defaults,
populate_annual_billing_with_the_previous_years_allowance, populate_annual_billing_with_the_previous_years_allowance,
purge_functional_test_data, purge_functional_test_data,
update_jobs_archived_flag,
) )
from app.dao.inbound_numbers_dao import dao_get_available_inbound_numbers from app.dao.inbound_numbers_dao import dao_get_available_inbound_numbers
from app.models import AnnualBilling, Notification, Template, User from app.models import AnnualBilling, Job, Notification, Template, User
from tests.app.db import ( from tests.app.db import (
create_annual_billing, create_annual_billing,
create_job,
create_notification, create_notification,
create_service, create_service,
create_template,
) )
@@ -62,38 +67,32 @@ def test_purge_functional_test_data(notify_db_session, notify_api):
# assert user_count == 0 # assert user_count == 0
# def test_update_jobs_archived_flag(notify_db_session, notify_api): def test_update_jobs_archived_flag(notify_db_session, notify_api):
#
# service_count = Service.query.count() service = create_service()
# assert service_count == 0
# sms_template = create_template(service=service, template_type='sms')
# service = create_service() create_job(sms_template)
# service_count = Service.query.count()
# assert service_count == 1 right_now = datetime.datetime.utcnow()
# tomorrow = right_now + datetime.timedelta(days=1)
# sms_template = create_template(service=service, template_type='sms')
# create_job(sms_template) right_now = right_now.strftime("%Y-%m-%d")
# tomorrow = tomorrow.strftime("%Y-%m-%d")
# # run the command
# one_hour_past = datetime.datetime.utcnow() archived_jobs = Job.query.filter(Job.archived is True).count()
# one_hour_future = datetime.datetime.utcnow() + datetime.timedelta(days=1) assert archived_jobs == 0
#
# one_hour_past = one_hour_past.strftime("%Y-%m-%d") notify_api.test_cli_runner().invoke(
# one_hour_future = one_hour_future.strftime("%Y-%m-%d") update_jobs_archived_flag, [
# '-e', tomorrow,
# archived_jobs = Job.query.filter(Job.archived is True).count() '-s', right_now,
# assert archived_jobs == 0 ]
# )
# notify_api.test_cli_runner().invoke( jobs = Job.query.all()
# update_jobs_archived_flag, [ assert len(jobs) == 1
# '-e', one_hour_future, for job in jobs:
# '-s', one_hour_past, assert job.archived is True
# ]
# )
# jobs = Job.query.all()
# assert len(jobs) == 1
# for job in jobs:
# assert job.archived is True
# def test_populate_organizations_from_file(notify_db_session, notify_api): # def test_populate_organizations_from_file(notify_db_session, notify_api):