diff --git a/app/letter_branding/letter_branding_schema.py b/app/letter_branding/letter_branding_schema.py index d6275c82d..3c7acb7b0 100644 --- a/app/letter_branding/letter_branding_schema.py +++ b/app/letter_branding/letter_branding_schema.py @@ -6,5 +6,5 @@ post_letter_branding_schema = { "name": {"type": ["string", "null"]}, "filename": {"type": ["string", "null"]}, }, - "required": ("name", "filename") + "required": ["name", "filename"] } diff --git a/requirements.in b/requirements.in index 9d4ede6d9..d920aa8e4 100644 --- a/requirements.in +++ b/requirements.in @@ -13,13 +13,13 @@ click-datetime==0.2 git+https://github.com/benoitc/gunicorn.git@1299ea9e967a61ae2edebe191082fd169b864c64#egg=gunicorn[eventlet]==20.1.0 iso8601==1.0.2 itsdangerous==2.1.2 -jsonschema==3.2.0 +jsonschema==4.4.0 marshmallow-sqlalchemy==0.23.1 # pyup: <0.24.0 # marshmallow v3 throws errors marshmallow==2.21.0 # pyup: <3 # v3 throws errors psycopg2-binary==2.9.3 PyJWT==2.3.0 SQLAlchemy==1.4.35 -strict-rfc3339==0.7 +rfc3339-validator==0.1.4 rfc3987==1.3.8 cachetools==5.0.0 beautifulsoup4==4.10.0 diff --git a/requirements.txt b/requirements.txt index c3c3dd044..c6a820a2d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -123,7 +123,7 @@ jmespath==0.10.0 # via # boto3 # botocore -jsonschema==3.2.0 +jsonschema==4.4.0 # via -r requirements.in kombu==5.2.3 # via celery @@ -200,6 +200,8 @@ requests==2.26.0 # govuk-bank-holidays # notifications-python-client # notifications-utils +rfc3339-validator==0.1.4 + # via -r requirements.in rfc3987==1.3.8 # via -r requirements.in rsa==4.7.2 @@ -218,8 +220,8 @@ six==1.16.0 # click-repl # eventlet # flask-marshmallow - # jsonschema # python-dateutil + # rfc3339-validator smartypants==2.0.1 # via notifications-utils soupsieve==2.2.1 @@ -231,8 +233,6 @@ sqlalchemy==1.4.35 # marshmallow-sqlalchemy statsd==3.3.0 # via notifications-utils -strict-rfc3339==0.7 - # via -r requirements.in urllib3==1.26.7 # via # botocore diff --git a/tests/app/complaint/test_complaint_rest.py b/tests/app/complaint/test_complaint_rest.py index ea44ca636..5f72e4ee2 100644 --- a/tests/app/complaint/test_complaint_rest.py +++ b/tests/app/complaint/test_complaint_rest.py @@ -87,5 +87,4 @@ def test_get_complaint_with_invalid_data_returns_400_status_code(client): ) assert response.status_code == 400 - assert response.json['errors'][0]['message'] == 'start_date time data {} does not match format %Y-%m-%d'.format( - start_date) + assert response.json['errors'][0]['message'] == 'start_date month must be in 1..12' diff --git a/tests/app/platform_stats/test_rest.py b/tests/app/platform_stats/test_rest.py index 27ba169e0..eda62b1dd 100644 --- a/tests/app/platform_stats/test_rest.py +++ b/tests/app/platform_stats/test_rest.py @@ -48,8 +48,7 @@ def test_get_platform_stats_validates_the_date(admin_request): _expected_status=400 ) - assert response['errors'][0]['message'] == 'start_date time data {} does not match format %Y-%m-%d'.format( - start_date) + assert response['errors'][0]['message'] == 'start_date month must be in 1..12' @freeze_time('2018-10-31 14:00')