Require PE id to be defined in financial verification form
This commit is contained in:
parent
994af840d9
commit
edcd8bb921
@ -70,7 +70,7 @@ class FinancialForm(ValidatedForm):
|
|||||||
"Unique Item Identifier (UII)s related to your application(s) if you already have them."
|
"Unique Item Identifier (UII)s related to your application(s) if you already have them."
|
||||||
)
|
)
|
||||||
|
|
||||||
pe_id = StringField("Program Element (PE) Number related to your request")
|
pe_id = StringField("Program Element (PE) Number related to your request", validators=[Required()])
|
||||||
|
|
||||||
treasury_code = StringField("Program Treasury Code")
|
treasury_code = StringField("Program Treasury Code")
|
||||||
|
|
||||||
|
@ -25,10 +25,10 @@ def update_financial_verification(request_id):
|
|||||||
|
|
||||||
if form.validate():
|
if form.validate():
|
||||||
request_data = {"financial_verification": post_data}
|
request_data = {"financial_verification": post_data}
|
||||||
Requests.update(request_id, request_data)
|
|
||||||
valid = form.perform_extra_validation(
|
valid = form.perform_extra_validation(
|
||||||
existing_request.body.get("financial_verification")
|
existing_request.body.get("financial_verification")
|
||||||
)
|
)
|
||||||
|
Requests.update(request_id, request_data)
|
||||||
if valid:
|
if valid:
|
||||||
return redirect(url_for("requests.financial_verification_submitted"))
|
return redirect(url_for("requests.financial_verification_submitted"))
|
||||||
else:
|
else:
|
||||||
|
@ -72,3 +72,14 @@ class TestPENumberInForm:
|
|||||||
|
|
||||||
assert response.status_code == 302
|
assert response.status_code == 302
|
||||||
assert "/requests/financial_verification_submitted" in response.headers.get("Location")
|
assert "/requests/financial_verification_submitted" in response.headers.get("Location")
|
||||||
|
|
||||||
|
def test_submit_request_form_with_missing_pe_id(self, monkeypatch, client):
|
||||||
|
self._set_monkeypatches(monkeypatch)
|
||||||
|
|
||||||
|
data = dict(self.required_data)
|
||||||
|
data['pe_id'] = ''
|
||||||
|
|
||||||
|
response = self.submit_data(client, data)
|
||||||
|
|
||||||
|
assert "There were some errors, see below" in response.data.decode()
|
||||||
|
assert response.status_code == 200
|
||||||
|
Loading…
x
Reference in New Issue
Block a user