diff --git a/tests/app/celery/test_csv_files/email.csv b/tests/app/celery/test_csv_files/email.csv new file mode 100644 index 000000000..f0cefee69 --- /dev/null +++ b/tests/app/celery/test_csv_files/email.csv @@ -0,0 +1,2 @@ +email_address +test@test.com diff --git a/tests/app/celery/test_csv_files/empty.csv b/tests/app/celery/test_csv_files/empty.csv new file mode 100644 index 000000000..64e5bd0a3 --- /dev/null +++ b/tests/app/celery/test_csv_files/empty.csv @@ -0,0 +1 @@ +phone number diff --git a/tests/app/celery/test_csv_files/multiple_email.csv b/tests/app/celery/test_csv_files/multiple_email.csv new file mode 100644 index 000000000..5da15797d --- /dev/null +++ b/tests/app/celery/test_csv_files/multiple_email.csv @@ -0,0 +1,11 @@ +EMAILADDRESS +test1@test.com +test2@test.com +test3@test.com +test4@test.com +test5@test.com +test6@test.com +test7@test.com +test8@test.com +test9@test.com +test0@test.com diff --git a/tests/app/celery/test_csv_files/multiple_letter.csv b/tests/app/celery/test_csv_files/multiple_letter.csv new file mode 100644 index 000000000..0e9d847b8 --- /dev/null +++ b/tests/app/celery/test_csv_files/multiple_letter.csv @@ -0,0 +1,11 @@ +address_line_1, address_line_2, address_line_3 +name1, street1, town1, postcode1 +name2, street2, town2, postcode2 +name3, street3, town3, postcode3 +name4, street4, town4, postcode4 +name5, street5, town5, postcode5 +name6, street6, town6, postcode6 +name7, street7, town7, postcode7 +name8, street8, town8, postcode8 +name9, street9, town9, postcode9 +name0, street0, town0, postcode0 \ No newline at end of file diff --git a/tests/app/celery/test_csv_files/multiple_sms.csv b/tests/app/celery/test_csv_files/multiple_sms.csv new file mode 100644 index 000000000..2ecad9140 --- /dev/null +++ b/tests/app/celery/test_csv_files/multiple_sms.csv @@ -0,0 +1,11 @@ +PhoneNumber,Name ++441234123121,chris ++441234123122,chris ++441234123123,chris ++441234123124,chris ++441234123125,chris ++441234123126,chris ++441234123127,chris ++441234123128,chris ++441234123129,chris ++441234123120,chris diff --git a/tests/app/celery/test_csv_files/sms.csv b/tests/app/celery/test_csv_files/sms.csv new file mode 100644 index 000000000..728639972 --- /dev/null +++ b/tests/app/celery/test_csv_files/sms.csv @@ -0,0 +1,2 @@ +PHONE NUMBER, IGNORE THIS COLUMN ++441234123123, nope diff --git a/tests/app/celery/test_scheduled_tasks.py b/tests/app/celery/test_scheduled_tasks.py index 7f60318cc..6f63f7396 100644 --- a/tests/app/celery/test_scheduled_tasks.py +++ b/tests/app/celery/test_scheduled_tasks.py @@ -56,19 +56,16 @@ from app.models import ( from app.utils import get_london_midnight_in_utc from app.v2.errors import JobIncompleteError from tests.app.db import create_notification, create_service, create_template, create_job, create_rate + from tests.app.conftest import ( sample_job as create_sample_job, + sample_notification_history as create_notification_history, + sample_template as create_sample_template, create_custom_template, datetime_in_past ) from tests.app.aws.test_s3 import single_s3_object_stub -from tests.conftest import set_config_values, notify_db, notify_db_session - -from tests.app.conftest import ( - sample_notification as create_notification, - sample_notification_history as create_notification_history, - sample_template as create_sample_template -) +from tests.conftest import set_config_values def _create_slow_delivery_notification(provider='mmg'): diff --git a/tests/app/dao/test_services_dao.py b/tests/app/dao/test_services_dao.py index bc5a8af82..8a28e13dd 100644 --- a/tests/app/dao/test_services_dao.py +++ b/tests/app/dao/test_services_dao.py @@ -31,7 +31,8 @@ from app.dao.services_dao import ( dao_resume_service, dao_fetch_active_users_for_service, dao_fetch_service_by_inbound_number, - dao_fetch_monthly_historical_stats_by_template_for_service_without_status) + dao_fetch_monthly_historical_stats_by_template +) from app.dao.service_permissions_dao import dao_add_service_permission, dao_remove_service_permission from app.dao.users_dao import save_model_user from app.models import ( @@ -1022,7 +1023,7 @@ def test_dao_fetch_monthly_historical_stats_by_template(notify_db, notify_db_ses notification_history(created_at=datetime(2016, 4, 1), sample_template=template_two) notification_history(created_at=datetime.now(), sample_template=template_two) - results = dao_fetch_monthly_historical_stats_by_template_for_service_without_status() + results = dao_fetch_monthly_historical_stats_by_template() assert len(results) == 2