mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
Fix codestyle
This commit is contained in:
@@ -4,7 +4,6 @@ import pytest
|
|||||||
from flask import json
|
from flask import json
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
from notifications_utils.url_safe_token import generate_token
|
from notifications_utils.url_safe_token import generate_token
|
||||||
|
|
||||||
from tests import create_authorization_header
|
from tests import create_authorization_header
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +27,7 @@ def test_accept_invite_returns_200_when_token_valid(notify_api, sample_invited_u
|
|||||||
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:
|
||||||
token = generate_token(str(sample_invited_user.id), notify_api.config['SECRET_KEY'],
|
token = generate_token(str(sample_invited_user.id), notify_api.config['SECRET_KEY'],
|
||||||
notify_api.config['DANGEROUS_SALT'])
|
notify_api.config['DANGEROUS_SALT'])
|
||||||
url = '/invite/{}'.format(token)
|
url = '/invite/{}'.format(token)
|
||||||
auth_header = create_authorization_header()
|
auth_header = create_authorization_header()
|
||||||
response = client.get(url, headers=[('Content-Type', 'application/json'), auth_header])
|
response = client.get(url, headers=[('Content-Type', 'application/json'), auth_header])
|
||||||
@@ -38,17 +37,16 @@ def test_accept_invite_returns_200_when_token_valid(notify_api, sample_invited_u
|
|||||||
assert json_resp['data']['id'] == str(sample_invited_user.id)
|
assert json_resp['data']['id'] == str(sample_invited_user.id)
|
||||||
assert json_resp['data']['email_address'] == sample_invited_user.email_address
|
assert json_resp['data']['email_address'] == sample_invited_user.email_address
|
||||||
assert json_resp['data']['from_user'] == str(sample_invited_user.user_id)
|
assert json_resp['data']['from_user'] == str(sample_invited_user.user_id)
|
||||||
assert json_resp['data']['service']== str(sample_invited_user.service_id)
|
assert json_resp['data']['service'] == str(sample_invited_user.service_id)
|
||||||
assert json_resp['data']['status'] == sample_invited_user.status
|
assert json_resp['data']['status'] == sample_invited_user.status
|
||||||
assert json_resp['data']['permissions'] == sample_invited_user.permissions
|
assert json_resp['data']['permissions'] == sample_invited_user.permissions
|
||||||
|
|
||||||
|
|
||||||
|
def test_accept_invite_returns_400_when_invited_user_does_not_exist(notify_api):
|
||||||
def test_accept_invite_returns_200_when_token_valid(notify_api):
|
|
||||||
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:
|
||||||
token = generate_token(str(uuid.uuid4()), notify_api.config['SECRET_KEY'],
|
token = generate_token(str(uuid.uuid4()), notify_api.config['SECRET_KEY'],
|
||||||
notify_api.config['DANGEROUS_SALT'])
|
notify_api.config['DANGEROUS_SALT'])
|
||||||
url = '/invite/{}'.format(token)
|
url = '/invite/{}'.format(token)
|
||||||
auth_header = create_authorization_header()
|
auth_header = create_authorization_header()
|
||||||
response = client.get(url, headers=[('Content-Type', 'application/json'), auth_header])
|
response = client.get(url, headers=[('Content-Type', 'application/json'), auth_header])
|
||||||
|
|||||||
Reference in New Issue
Block a user