mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
Fixed imports which were producing broken tests
- Some tests for failing because of an import which was overriding the one above it in test_scheduled_tasks.py - Import error fixed in test_services_dao.py after a rename of a method
This commit is contained in:
2
tests/app/celery/test_csv_files/email.csv
Normal file
2
tests/app/celery/test_csv_files/email.csv
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
email_address
|
||||||
|
test@test.com
|
||||||
|
1
tests/app/celery/test_csv_files/empty.csv
Normal file
1
tests/app/celery/test_csv_files/empty.csv
Normal file
@@ -0,0 +1 @@
|
|||||||
|
phone number
|
||||||
|
11
tests/app/celery/test_csv_files/multiple_email.csv
Normal file
11
tests/app/celery/test_csv_files/multiple_email.csv
Normal file
@@ -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
|
||||||
|
11
tests/app/celery/test_csv_files/multiple_letter.csv
Normal file
11
tests/app/celery/test_csv_files/multiple_letter.csv
Normal file
@@ -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
|
||||||
|
11
tests/app/celery/test_csv_files/multiple_sms.csv
Normal file
11
tests/app/celery/test_csv_files/multiple_sms.csv
Normal file
@@ -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
|
||||||
|
2
tests/app/celery/test_csv_files/sms.csv
Normal file
2
tests/app/celery/test_csv_files/sms.csv
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
PHONE NUMBER, IGNORE THIS COLUMN
|
||||||
|
+441234123123, nope
|
||||||
|
@@ -56,19 +56,16 @@ from app.models import (
|
|||||||
from app.utils import get_london_midnight_in_utc
|
from app.utils import get_london_midnight_in_utc
|
||||||
from app.v2.errors import JobIncompleteError
|
from app.v2.errors import JobIncompleteError
|
||||||
from tests.app.db import create_notification, create_service, create_template, create_job, create_rate
|
from tests.app.db import create_notification, create_service, create_template, create_job, create_rate
|
||||||
|
|
||||||
from tests.app.conftest import (
|
from tests.app.conftest import (
|
||||||
sample_job as create_sample_job,
|
sample_job as create_sample_job,
|
||||||
|
sample_notification_history as create_notification_history,
|
||||||
|
sample_template as create_sample_template,
|
||||||
create_custom_template,
|
create_custom_template,
|
||||||
datetime_in_past
|
datetime_in_past
|
||||||
)
|
)
|
||||||
from tests.app.aws.test_s3 import single_s3_object_stub
|
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.conftest import set_config_values
|
||||||
|
|
||||||
from tests.app.conftest import (
|
|
||||||
sample_notification as create_notification,
|
|
||||||
sample_notification_history as create_notification_history,
|
|
||||||
sample_template as create_sample_template
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def _create_slow_delivery_notification(provider='mmg'):
|
def _create_slow_delivery_notification(provider='mmg'):
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ from app.dao.services_dao import (
|
|||||||
dao_resume_service,
|
dao_resume_service,
|
||||||
dao_fetch_active_users_for_service,
|
dao_fetch_active_users_for_service,
|
||||||
dao_fetch_service_by_inbound_number,
|
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.service_permissions_dao import dao_add_service_permission, dao_remove_service_permission
|
||||||
from app.dao.users_dao import save_model_user
|
from app.dao.users_dao import save_model_user
|
||||||
from app.models import (
|
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(2016, 4, 1), sample_template=template_two)
|
||||||
notification_history(created_at=datetime.now(), 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
|
assert len(results) == 2
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user