Funding type other input is only required if funding type is other
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from atst.forms.financial import suggest_pe_id
|
||||
from atst.forms.financial import suggest_pe_id, FinancialForm
|
||||
|
||||
|
||||
@pytest.mark.parametrize("input_,expected", [
|
||||
@@ -12,3 +12,21 @@ from atst.forms.financial import suggest_pe_id
|
||||
])
|
||||
def test_suggest_pe_id(input_, expected):
|
||||
assert suggest_pe_id(input_) == expected
|
||||
|
||||
|
||||
def test_funding_type_other_not_required_if_funding_type_is_not_other():
|
||||
form_data = {
|
||||
"funding_type": "PROC"
|
||||
}
|
||||
form = FinancialForm(data=form_data)
|
||||
form.validate()
|
||||
assert "funding_type_other" not in form.errors
|
||||
|
||||
|
||||
def test_funding_type_other_required_if_funding_type_is_other():
|
||||
form_data = {
|
||||
"funding_type": "OTHER"
|
||||
}
|
||||
form = FinancialForm(data=form_data)
|
||||
form.validate()
|
||||
assert "funding_type_other" in form.errors
|
||||
|
Reference in New Issue
Block a user