Skip to content

Commit

Permalink
test(cst): cover the new eligibilty form
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Jul 10, 2024
1 parent 4a74929 commit a65463d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/pytest/eligibility/test_forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
from benefits.eligibility.forms import MSTCourtesyCard, SBMTDMobilityPass
from benefits.eligibility.forms import CSTAgencyCard, MSTCourtesyCard, SBMTDMobilityPass


def test_CSTAgencyCard():
form = CSTAgencyCard(data={"sub": "12345", "name": "Gonzalez"})

assert form.is_valid()

sub_attrs = form.fields["sub"].widget.attrs
assert sub_attrs["pattern"] == r"\d{5}"
assert sub_attrs["inputmode"] == "numeric"
assert sub_attrs["maxlength"] == 5
assert sub_attrs["data-custom-validity"] == "Please enter a 5-digit number."

name_attrs = form.fields["name"].widget.attrs
assert name_attrs["maxlength"] == 255
assert name_attrs["data-custom-validity"] == "Please enter your last name."

assert form.use_custom_validity


def test_MSTCourtesyCard():
Expand Down

0 comments on commit a65463d

Please sign in to comment.