Merge pull request #4061 from alphagov/python39

Update app to use Python 3.9
This commit is contained in:
Katie Smith
2021-11-03 10:54:28 +00:00
committed by GitHub
4 changed files with 9 additions and 11 deletions

View File

@@ -11,7 +11,7 @@ GOV.UK Notify admin application - https://www.notifications.service.gov.uk/
### Python version
At the moment we run Python 3.6 in production.
At the moment we run Python 3.9 in production.
### NPM packages

View File

@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.6
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile requirements.in
@@ -43,8 +43,6 @@ cryptography==3.3.2
# via
# -r requirements.in
# fido2
dataclasses==0.8
# via werkzeug
dnspython==1.16.0
# via eventlet
docopt==0.6.2
@@ -90,10 +88,7 @@ humanize==3.12.0
idna==2.10
# via requests
importlib-metadata==4.2.0
# via
# -r requirements.in
# click
# humanize
# via -r requirements.in
itsdangerous==1.1.0
# via
# -r requirements.in
@@ -215,8 +210,6 @@ statsd==3.3.0
# via notifications-utils
texttable==1.6.3
# via pyexcel
typing-extensions==3.10.0.0
# via importlib-metadata
urllib3==1.26.5
# via
# botocore

View File

@@ -1 +1 @@
python-3.6.x
python-3.9.x

View File

@@ -5,6 +5,7 @@ from unittest.mock import Mock
import pytest
from notifications_utils.template import LetterPreviewTemplate
from app import load_service_before_request
from app.template_previews import (
TemplatePreview,
get_page_count_for_letter,
@@ -58,6 +59,10 @@ def test_from_database_object_makes_request(
expected_filename,
mock_get_service_letter_template
):
# This test is calling `current_service` outside a Flask endpoint, so we need to make sure
# `service` is in the `_request_ctx_stack` to avoid an error
load_service_before_request()
resp = Mock(content='a', status_code='b', headers={'c': 'd'})
request_mock = mocker.patch('app.template_previews.requests.post', return_value=resp)
mocker.patch('app.template_previews.current_service', letter_branding=letter_branding)