Remove POST param from agreement test

This test sent an empty string to represent the 'who' field not having a value. This is represented by a group of radios in the page.

In browsers, radios that aren't selected result in that field not being included in the HTTP parameters. This change makes the test match that.

The expected validation message is also changed to the one you see in a browser. Turns out [the WTForms DataRequired validator](https://wtforms.readthedocs.io/en/stable/validators.html#wtforms.validators.DataRequired) produces a different error message for an empty string vs the value being missing ("This field is required." vs "Not a valid choice").
This commit is contained in:
Tom Byers
2020-03-18 16:54:00 +00:00
committed by GitHub
parent b2a75af8bb
commit a5d8de5028

View File

@@ -272,12 +272,11 @@ def test_accept_agreement_page_populates(
(
{
'version': '',
'who': '',
'on_behalf_of_name': '',
'on_behalf_of_email': '',
},
[
'This field is required.',
'Not a valid choice',
'Must be a number',
],
),