Use dashes in the celery queue names

This commit is contained in:
Rebecca Law
2016-02-18 11:18:35 +00:00
parent 9b99782662
commit 9ea2acfdae
2 changed files with 6 additions and 6 deletions

View File

@@ -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

View File

@@ -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):