diff --git a/app/user/rest.py b/app/user/rest.py index 327ce5aa6..878176461 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -139,7 +139,7 @@ def send_user_code(user_id): if verify_code.get('code_type') == 'sms': mobile = user.mobile_number if verify_code.get('to', None) is None else verify_code.get('to') verification_message = {'to': mobile, 'secret_code': secret_code} - send_sms_code.apply_async([encryption.encrypt(verification_message)], queue='sms_code') + send_sms_code.apply_async([encryption.encrypt(verification_message)], queue='sms-code') elif verify_code.get('code_type') == 'email': email = user.email_address if verify_code.get('to', None) is None else verify_code.get('to') verification_message = { @@ -147,7 +147,7 @@ def send_user_code(user_id): 'from_address': current_app.config['VERIFY_CODE_FROM_EMAIL_ADDRESS'], 'subject': 'Verification code', 'body': secret_code} - send_email_code.apply_async([encryption.encrypt(verification_message)], queue='email_code') + send_email_code.apply_async([encryption.encrypt(verification_message)], queue='email-code') else: abort(500) return jsonify({}), 204 diff --git a/tests/app/user/test_rest_verify.py b/tests/app/user/test_rest_verify.py index 938e6599d..e6759f45b 100644 --- a/tests/app/user/test_rest_verify.py +++ b/tests/app/user/test_rest_verify.py @@ -270,7 +270,7 @@ def test_send_user_code_for_sms(notify_api, assert resp.status_code == 204 encrpyted = encryption.encrypt({'to': sample_sms_code.user.mobile_number, 'secret_code': '11111'}) - app.celery.tasks.send_sms_code.apply_async.assert_called_once_with([encrpyted], queue='sms_code') + app.celery.tasks.send_sms_code.apply_async.assert_called_once_with([encrpyted], queue='sms-code') def test_send_user_code_for_sms_with_optional_to_field(notify_api, @@ -295,7 +295,7 @@ def test_send_user_code_for_sms_with_optional_to_field(notify_api, assert resp.status_code == 204 encrypted = encryption.encrypt({'to': '+441119876757', 'secret_code': '11111'}) - app.celery.tasks.send_sms_code.apply_async.assert_called_once_with([encrypted], queue='sms_code') + app.celery.tasks.send_sms_code.apply_async.assert_called_once_with([encrypted], queue='sms-code') def test_send_user_code_for_email(notify_api, @@ -320,7 +320,7 @@ def test_send_user_code_for_email(notify_api, assert resp.status_code == 204 app.celery.tasks.send_email_code.apply_async.assert_called_once_with(['something_encrypted'], - queue='email_code') + queue='email-code') def test_send_user_code_for_email_uses_optional_to_field(notify_api, @@ -345,7 +345,7 @@ def test_send_user_code_for_email_uses_optional_to_field(notify_api, assert resp.status_code == 204 app.celery.tasks.send_email_code.apply_async.assert_called_once_with(['something_encrypted'], - queue='email_code') + queue='email-code') def test_request_verify_code_schema_invalid_code_type(notify_api, notify_db, notify_db_session, sample_user):