mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-08 16:53:12 -04:00
Update to test as per review comments.
However, I am curious if there is evidence that using fake_uuid over creating one in the test is actually faster.
This commit is contained in:
@@ -163,7 +163,7 @@ def process_job(job_id):
|
|||||||
if template.template_type == 'sms':
|
if template.template_type == 'sms':
|
||||||
send_sms.apply_async((
|
send_sms.apply_async((
|
||||||
str(job.service_id),
|
str(job.service_id),
|
||||||
str(create_uuid()),
|
create_uuid(),
|
||||||
encrypted,
|
encrypted,
|
||||||
datetime.utcnow().strftime(DATETIME_FORMAT)),
|
datetime.utcnow().strftime(DATETIME_FORMAT)),
|
||||||
queue='bulk-sms'
|
queue='bulk-sms'
|
||||||
@@ -172,7 +172,7 @@ def process_job(job_id):
|
|||||||
if template.template_type == 'email':
|
if template.template_type == 'email':
|
||||||
send_email.apply_async((
|
send_email.apply_async((
|
||||||
str(job.service_id),
|
str(job.service_id),
|
||||||
str(create_uuid()),
|
create_uuid(),
|
||||||
'"{}" <{}@{}>'.format(
|
'"{}" <{}@{}>'.format(
|
||||||
service.name,
|
service.name,
|
||||||
service.email_from,
|
service.email_from,
|
||||||
|
|||||||
@@ -276,14 +276,14 @@ def test_authentication_returns_error_when_api_client_has_no_secrets(notify_api,
|
|||||||
def test_authentication_returns_error_when_service_has_no_secrets(notify_api,
|
def test_authentication_returns_error_when_service_has_no_secrets(notify_api,
|
||||||
notify_db,
|
notify_db,
|
||||||
notify_db_session,
|
notify_db_session,
|
||||||
sample_service):
|
sample_service,
|
||||||
|
fake_uuid):
|
||||||
with notify_api.test_request_context():
|
with notify_api.test_request_context():
|
||||||
with notify_api.test_client() as client:
|
with notify_api.test_client() as client:
|
||||||
import uuid
|
|
||||||
token = create_jwt_token(
|
token = create_jwt_token(
|
||||||
request_method="GET",
|
request_method="GET",
|
||||||
request_path='/service',
|
request_path='/service',
|
||||||
secret=str(uuid.uuid4()),
|
secret=fake_uuid,
|
||||||
client_id=str(sample_service.id))
|
client_id=str(sample_service.id))
|
||||||
|
|
||||||
response = client.get(
|
response = client.get(
|
||||||
|
|||||||
Reference in New Issue
Block a user