Merge pull request #2332 from alphagov/pyup-update-flake8-3.6.0-to-3.7.3

Update flake8 to 3.7.3
This commit is contained in:
Pea (Malgorzata Tyczynska)
2019-01-31 15:27:47 +00:00
committed by GitHub
4 changed files with 25 additions and 25 deletions

View File

@@ -36,16 +36,16 @@ git+https://github.com/alphagov/notifications-utils.git@30.7.4#egg=notifications
git+https://github.com/alphagov/boto.git@2.43.0-patch3#egg=boto==2.43.0-patch3
## The following requirements were added by pip freeze:
alembic==1.0.6
alembic==1.0.7
amqp==1.4.9
anyjson==0.3.3
attrs==18.2.0
awscli==1.16.95
awscli==1.16.96
bcrypt==3.1.6
billiard==3.3.0.23
bleach==3.0.2
boto3==1.6.16
botocore==1.12.85
botocore==1.12.86
certifi==2018.11.29
chardet==3.0.4
Click==7.0
@@ -73,7 +73,7 @@ python-editor==1.0.3
python-json-logger==0.1.10
pytz==2018.9
PyYAML==3.12
redis==3.0.1
redis==3.1.0
requests==2.21.0
rsa==3.4.2
s3transfer==0.1.13

View File

@@ -1,5 +1,5 @@
-r requirements.txt
flake8==3.6.0
flake8==3.7.3
pytest==3.10.1
moto==1.3.7
pytest-env==0.6.2

View File

@@ -9,19 +9,19 @@ from tests import create_authorization_header
@pytest.mark.parametrize('invitation_type', ['service', 'organisation'])
def test_validate_invitation_token_for_expired_token_returns_400(client, invitation_type):
with freeze_time('2016-01-01T12:00:00'):
token = generate_token(str(uuid.uuid4()), current_app.config['SECRET_KEY'],
current_app.config['DANGEROUS_SALT'])
url = '/invite/{}/{}'.format(invitation_type, token)
auth_header = create_authorization_header()
response = client.get(url, headers=[('Content-Type', 'application/json'), auth_header])
with freeze_time('2016-01-01T12:00:00'):
token = generate_token(str(uuid.uuid4()), current_app.config['SECRET_KEY'],
current_app.config['DANGEROUS_SALT'])
url = '/invite/{}/{}'.format(invitation_type, token)
auth_header = create_authorization_header()
response = client.get(url, headers=[('Content-Type', 'application/json'), auth_header])
assert response.status_code == 400
json_resp = json.loads(response.get_data(as_text=True))
assert json_resp['result'] == 'error'
assert json_resp['message'] == {'invitation': [
'Your invitation to GOV.UK Notify has expired. '
'Please ask the person that invited you to send you another one']}
assert response.status_code == 400
json_resp = json.loads(response.get_data(as_text=True))
assert json_resp['result'] == 'error'
assert json_resp['message'] == {'invitation': [
'Your invitation to GOV.UK Notify has expired. '
'Please ask the person that invited you to send you another one']}
@pytest.mark.parametrize('invitation_type', ['service', 'organisation'])

View File

@@ -4,17 +4,17 @@ encryption = Encryption()
def test_should_encrypt_content(notify_api):
encryption.init_app(notify_api)
assert encryption.encrypt("this") != "this"
encryption.init_app(notify_api)
assert encryption.encrypt("this") != "this"
def test_should_decrypt_content(notify_api):
encryption.init_app(notify_api)
encrypted = encryption.encrypt("this")
assert encryption.decrypt(encrypted) == "this"
encryption.init_app(notify_api)
encrypted = encryption.encrypt("this")
assert encryption.decrypt(encrypted) == "this"
def test_should_encrypt_json(notify_api):
encryption.init_app(notify_api)
encrypted = encryption.encrypt({"this": "that"})
assert encryption.decrypt(encrypted) == {"this": "that"}
encryption.init_app(notify_api)
encrypted = encryption.encrypt({"this": "that"})
assert encryption.decrypt(encrypted) == {"this": "that"}