Skip to content

Commit

Permalink
Merge pull request #39 from LandRegistry/v2
Browse files Browse the repository at this point in the history
v2.0.0
  • Loading branch information
matthew-shaw authored Jan 13, 2022
2 parents fd29cfa + 5300a58 commit a957772
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/LandRegistry/govuk-frontend-wtf/compare/1.2.1..main)
## [Unreleased](https://github.com/LandRegistry/govuk-frontend-wtf/compare/2.0.0..main)

## [2.0.0](https://github.com/LandRegistry/govuk-frontend-wtf/releases/tag/2.0.0) - 13/01/2022

### Added

- [GOV.UK Frontend v4.0.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.0.0) support

### Removed

- Python 3.6 support

## [1.2.1](https://github.com/LandRegistry/govuk-frontend-wtf/releases/tag/1.2.1) - 08/12/2021

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GOV.UK Frontend WTForms Widgets

[![PyPI version](https://badge.fury.io/py/govuk-frontend-wtf.svg)](https://pypi.org/project/govuk-frontend-wtf/)
![govuk-frontend 3.14.0](https://img.shields.io/badge/govuk--frontend%20version-3.14.0-005EA5?logo=gov.uk&style=flat)
![govuk-frontend 4.0.0](https://img.shields.io/badge/govuk--frontend%20version-4.0.0-005EA5?logo=gov.uk&style=flat)
[![Python package](https://github.com/LandRegistry/govuk-frontend-wtf/actions/workflows/python-package.yml/badge.svg)](https://github.com/LandRegistry/govuk-frontend-wtf/actions/workflows/python-package.yml)

**GOV.UK Frontend WTForms is a [community tool](https://design-system.service.gov.uk/community/resources-and-tools/) of the [GOV.UK Design System](https://design-system.service.gov.uk/). The Design System team is not responsible for it and cannot support you with using it. Contact the [maintainers](#contributors) directly if you need [help](#support) or you want to request a feature.**
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setuptools.setup(
name="govuk-frontend-wtf",
version="1.2.1",
version="2.0.0",
author="Matt Shaw",
author_email="matthew.shaw@landregistry.gov.uk",
description="GOV.UK Frontend WTForms Widgets",
Expand All @@ -33,12 +33,12 @@
"Topic :: Software Development :: User Interfaces",
"Topic :: Text Processing :: Markup :: HTML",
],
python_requires=">=3.6",
python_requires=">=3.7",
install_requires=[
"deepmerge",
"flask",
"flask-wtf",
"govuk-frontend-jinja<2.0.0",
"govuk-frontend-jinja>=2.0.0",
"jinja2",
"wtforms",
],
Expand Down
38 changes: 19 additions & 19 deletions tests/fixtures/wtf_widgets_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TestStringField:
expected_output:
- <input class="govuk-input govuk-input--error" id="string_field" name="string_field" type="text" value="foo" aria-describedby="string_field-hint string_field-error" required="required">
- <label class="govuk-label" for="string_field">\s*StringField\s*</label>
- <span id="string_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Example serverside error - type &#34;John Smith&#34; into this field to suppress it\s*</span>
- <p id="string_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Example serverside error - type &#34;John Smith&#34; into this field to suppress it\s*</p>
- <div class="govuk-form-group govuk-form-group--error">
- <div id="string_field-hint" class="govuk-hint">\s*StringFieldHint\s*</div>

Expand Down Expand Up @@ -144,7 +144,7 @@ TestEmailField:
data:
email_field: foo
expected_output:
- <span id="email_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Email is not valid\s*</span>
- <p id="email_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Email is not valid\s*</p>
- <div id="email_field-hint" class="govuk-hint">\s*EmailFieldHint\s*</div>
- <label class="govuk-label" for="email_field">\s*EmailField\s*</label>
- <input class="govuk-input govuk-input--error" id="email_field" name="email_field" type="email" spellcheck="false" value="foo" aria-describedby="email_field-hint email_field-error" autocomplete="email" required="required">
Expand Down Expand Up @@ -184,7 +184,7 @@ TestFloatField:
expected_output:
- <input class="govuk-input govuk-input--error" id="float_field" name="float_field" type="text" value="foo" aria-describedby="float_field-hint float_field-error" required="required">
- <label class="govuk-label" for="float_field">\s*FloatField\s*</label>
- <span id="float_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid float value.\s*</span>
- <p id="float_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid float value.\s*</p>
- <div class="govuk-form-group govuk-form-group--error">
- <div id="float_field-hint" class="govuk-hint">\s*FloatFieldHint\s*</div>

Expand Down Expand Up @@ -222,7 +222,7 @@ TestIntegerField:
expected_output:
- <input class="govuk-input govuk-input--error" id="integer_field" name="integer_field" type="text" value="1.4" aria-describedby="integer_field-hint integer_field-error" required="required">
- <label class="govuk-label" for="integer_field">\s*IntegerField\s*</label>
- <span id="integer_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid integer value.\s*</span>
- <p id="integer_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid integer value.\s*</p>
- <div class="govuk-form-group govuk-form-group--error">
- <div id="integer_field-hint" class="govuk-hint">\s*IntegerFieldHint\s*</div>

Expand Down Expand Up @@ -260,7 +260,7 @@ TestDecimalField:
expected_output:
- <input class="govuk-input govuk-input--error" id="decimal_field" name="decimal_field" type="text" value="foo" aria-describedby="decimal_field-hint decimal_field-error" required="required">
- <label class="govuk-label" for="decimal_field">\s*DecimalField\s*</label>
- <span id="decimal_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid decimal value.\s*</span>
- <p id="decimal_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid decimal value.\s*</p>
- <div class="govuk-form-group govuk-form-group--error">
- <div id="decimal_field-hint" class="govuk-hint">\s*DecimalFieldHint\s*</div>

Expand Down Expand Up @@ -300,7 +300,7 @@ TestTextAreaField:
expected_output:
- <textarea class="govuk-textarea govuk-textarea--error" id="textarea_field" name="textarea_field" rows="5" aria-describedby="textarea_field-hint textarea_field-error" required="required"></textarea>
- <label class="govuk-label" for="textarea_field">\s*TextAreaField\s*</label>
- <span id="textarea_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*TextAreaField is required\s*</span>
- <p id="textarea_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*TextAreaField is required\s*</p>
- <div class="govuk-form-group govuk-form-group--error">
- <div id="textarea_field-hint" class="govuk-hint">\s*TextAreaFieldHint\s*</div>

Expand Down Expand Up @@ -342,7 +342,7 @@ TestCharacterCountField:
expected_output:
- <textarea class="govuk-textarea govuk-textarea--error govuk-js-character-count govuk-textarea--error" id="charactercount_field" name="charactercount_field" rows="5" aria-describedby="charactercount_field-info charactercount_field-hint charactercount_field-error" required="required"></textarea>
- <label class="govuk-label" for="charactercount_field">\s*CharacterCountField\s*</label>
- <span id="charactercount_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*CharacterCountField is required\s*</span>
- <p id="charactercount_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*CharacterCountField is required\s*</p>
- <div class="govuk-form-group govuk-form-group--error">
- <div id="charactercount_field-hint" class="govuk-hint">\s*CharacterCountFieldHint\s*</div>
- <div id="charactercount_field-info" class="govuk-hint govuk-character-count__message" aria-live="polite">\s*You can enter up to 200 characters\s*</div>
Expand Down Expand Up @@ -386,7 +386,7 @@ TestBooleanField:
method: post
expected_output:
- <div id="boolean_field-hint" class="govuk-hint">\s*BooleanFieldHint\s*</div>
- <span id="boolean_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Please tick the box\s*</span>
- <p id="boolean_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Please tick the box\s*</p>
- <div class="govuk-checkboxes"\s+data-module="govuk-checkboxes">
- <div class="govuk-checkboxes__item">
- <input class="govuk-checkboxes__input" id="boolean_field" name="boolean_field" type="checkbox" value="y" aria-describedby="boolean_field-hint boolean_field-error">
Expand Down Expand Up @@ -414,7 +414,7 @@ TestSelectMultipleField:
expected_output:
- <div class="govuk-form-group govuk-form-group--error">
- <fieldset class="govuk-fieldset" aria-describedby="select_multiple_field-hint select_multiple_field-error">
- <span id="select_multiple_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*&#39;&lt;script&gt;alert\(&#34;Hello&#34;\)&lt;/script&gt;&#39; is not a valid choice for this field.\s*</span>
- <p id="select_multiple_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*&#39;&lt;script&gt;alert\(&#34;Hello&#34;\)&lt;/script&gt;&#39; is not a valid choice for this field.\s*</p>
- <input class="govuk-checkboxes__input" id="select_multiple_field" name="select_multiple_field" type="checkbox" value="one">
- <label class="govuk-label govuk-checkboxes__label" for="select_multiple_field">\s*One\s*</label>
- <input class="govuk-checkboxes__input" id="select_multiple_field-2" name="select_multiple_field" type="checkbox" value="two">
Expand Down Expand Up @@ -449,7 +449,7 @@ TestSelectMultipleField:
expected_output:
- <div class="govuk-form-group govuk-form-group--error">
- <fieldset class="govuk-fieldset" aria-describedby="select_multiple_field-hint select_multiple_field-error">
- <span id="select_multiple_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*&#39;foo&#39; is not a valid choice for this field.\s*</span>
- <p id="select_multiple_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*&#39;foo&#39; is not a valid choice for this field.\s*</p>
- <input class="govuk-checkboxes__input" id="select_multiple_field" name="select_multiple_field" type="checkbox" value="one">
- <label class="govuk-label govuk-checkboxes__label" for="select_multiple_field">\s*One\s*</label>
- <input class="govuk-checkboxes__input" id="select_multiple_field-2" name="select_multiple_field" type="checkbox" value="two">
Expand Down Expand Up @@ -480,7 +480,7 @@ TestSelectField:
- <div class="govuk-form-group govuk-form-group--error">
- <label class="govuk-label" for="select_field">\s*SelectField\s*</label>
- <select class="govuk-select govuk-select--error" id="select_field" name="select_field" aria-describedby="select_field-hint select_field-error" required="required">
- <span id="select_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid choice.\s*</span>
- <p id="select_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid choice.\s*</p>
- <option value="">Please select</option>
- <option value="one">One</option>
- <option value="two">Two</option>
Expand Down Expand Up @@ -511,7 +511,7 @@ TestSelectField:
- <div class="govuk-form-group govuk-form-group--error">
- <label class="govuk-label" for="select_field">\s*SelectField\s*</label>
- <select class="govuk-select govuk-select--error" id="select_field" name="select_field" aria-describedby="select_field-hint select_field-error" required="required">
- <span id="select_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid choice.\s*</span>
- <p id="select_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid choice.\s*</p>
- <option value="">Please select</option>
- <option value="one">One</option>
- <option value="two">Two</option>
Expand All @@ -524,7 +524,7 @@ TestRadioField:
test_empty_get:
expected_output:
- <div class="govuk-form-group">
- <div class="govuk-radios">
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios__item">
- <input class="govuk-radios__input" id="radio_field" name="radio_field" type="radio" value="one">
- <label class="govuk-label govuk-radios__label" for="radio_field">\s*One\s*</label>
Expand All @@ -540,8 +540,8 @@ TestRadioField:
radio_field: <script>alert("Hello")</script>
expected_output:
- <div class="govuk-form-group govuk-form-group--error">
- <span id="radio_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid choice.\s*</span>
- <div class="govuk-radios">
- <p id="radio_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid choice.\s*</p>
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios__item">
- <input class="govuk-radios__input" id="radio_field" name="radio_field" type="radio" value="one">
- <label class="govuk-label govuk-radios__label" for="radio_field">\s*One\s*</label>
Expand All @@ -559,7 +559,7 @@ TestRadioField:
radio_field: two
expected_output:
- <div class="govuk-form-group">
- <div class="govuk-radios">
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios__item">
- <input class="govuk-radios__input" id="radio_field" name="radio_field" type="radio" value="one">
- <label class="govuk-label govuk-radios__label" for="radio_field">\s*One\s*</label>
Expand All @@ -575,8 +575,8 @@ TestRadioField:
radio_field: foo
expected_output:
- <div class="govuk-form-group govuk-form-group--error">
- <span id="radio_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid choice.\s*</span>
- <div class="govuk-radios">
- <p id="radio_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Not a valid choice.\s*</p>
- <div class="govuk-radios" data-module="govuk-radios">
- <div class="govuk-radios__item">
- <input class="govuk-radios__input" id="radio_field" name="radio_field" type="radio" value="one">
- <label class="govuk-label govuk-radios__label" for="radio_field">\s*One\s*</label>
Expand Down Expand Up @@ -707,7 +707,7 @@ TestPasswordField:
expected_output:
- <div class="govuk-form-group govuk-form-group--error">
- <label class="govuk-label" for="password_field">\s*PasswordField\s*</label>
- <span id="password_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Please ensure both password fields match\s*</span>
- <p id="password_field-error" class="govuk-error-message">\s*<span class="govuk-visually-hidden">\s*Error:\s*</span>\s*Please ensure both password fields match\s*</p>
# Ensure that passwords are not represented in the output for security reasons
- input class="govuk-input govuk-input--error" id="password_field" name="password_field" type="password" spellcheck="false" aria-describedby="password_field-hint password_field-error" required="required">
- <div id="password_field-hint" class="govuk-hint">\s*PasswordFieldHint\s*</div>
Expand Down
4 changes: 2 additions & 2 deletions tests/requirements.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
deepmerge==0.3.0
deepmerge==1.0.1
email_validator==1.1.3
flask-wtf==1.0.0
flask==2.0.2
govuk-frontend-jinja==1.5.1
govuk-frontend-jinja==2.0.0
pytest-cov==3.0.0
pyyaml==6.0
# Generated with piprot 0.9.10
Expand Down
10 changes: 5 additions & 5 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
#
# pip-compile requirements.in
#
attrs==21.2.0
attrs==21.4.0
# via pytest
click==8.0.3
# via flask
coverage[toml]==6.2
# via pytest-cov
deepmerge==0.3.0
deepmerge==1.0.1
# via -r requirements.in
dnspython==2.1.0
# via email-validator
Expand All @@ -22,7 +22,7 @@ flask==2.0.2
# flask-wtf
flask-wtf==1.0.0
# via -r requirements.in
govuk-frontend-jinja==1.5.1
govuk-frontend-jinja==2.0.0
# via -r requirements.in
idna==3.3
# via email-validator
Expand Down Expand Up @@ -56,9 +56,9 @@ pyyaml==6.0
# via -r requirements.in
toml==0.10.2
# via pytest
tomli==1.2.2
tomli==2.0.0
# via coverage
werkzeug==2.0.2
# via flask
wtforms==3.0.0
wtforms==3.0.1
# via flask-wtf

0 comments on commit a957772

Please sign in to comment.