diff --git a/app/config.py b/app/config.py index 8d10051ef..8d9fc7591 100644 --- a/app/config.py +++ b/app/config.py @@ -191,7 +191,7 @@ class Test(Config): Queue('send-email', Exchange('default'), routing_key='send-email'), Queue('research-mode', Exchange('default'), routing_key='research-mode') ] - REDIS_ENABLED = True + REDIS_ENABLED = False API_HOST_NAME = "http://localhost:6011" diff --git a/scripts/run_single_test.sh b/scripts/run_single_test.sh index 57e9428ab..0d1a6bfb9 100755 --- a/scripts/run_single_test.sh +++ b/scripts/run_single_test.sh @@ -1,4 +1,4 @@ #!/bin/bash # run a single unit test, pass in the unit test name for example: tests/app/service/test_rest.py::test_get_template_list source environment_test.sh -py.test -s $@ +py.test $@ diff --git a/tests/app/celery/test_scheduled_tasks.py b/tests/app/celery/test_scheduled_tasks.py index f5f1a44c9..4da1fcf56 100644 --- a/tests/app/celery/test_scheduled_tasks.py +++ b/tests/app/celery/test_scheduled_tasks.py @@ -26,14 +26,13 @@ def test_should_have_decorated_tasks_functions(): assert remove_csv_files.__wrapped__.__name__ == 'remove_csv_files' -def test_should_call_delete_notifications_more_than_week_in_task(notify_api, mocker): +def test_should_call_delete_successful_notifications_more_than_week_in_task(notify_api, mocker): mocked = mocker.patch('app.celery.scheduled_tasks.delete_notifications_created_more_than_a_week_ago') delete_successful_notifications() - assert mocked.assert_called_with('delivered') - assert scheduled_tasks.delete_notifications_created_more_than_a_week_ago.call_count == 1 + mocked.assert_called_once_with('delivered') -def test_should_call_delete_notifications_more_than_week_in_task(notify_api, mocker): +def test_should_call_delete_failed_notifications_more_than_week_in_task(notify_api, mocker): mocker.patch('app.celery.scheduled_tasks.delete_notifications_created_more_than_a_week_ago') delete_failed_notifications() assert scheduled_tasks.delete_notifications_created_more_than_a_week_ago.call_count == 4