Skip to content

Commit

Permalink
test(form): form is valid for positive expiration values
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Mar 14, 2024
1 parent c55c662 commit e3a2c13
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/pytest/core/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,17 @@ def test_EligibilityTypeForm_supports_expiration_True_zero_expiration_reenrollme

# our custom validation message for when supports_expiration is True
assert errors[0] == "When support_expiration is True, this value must be greater than 0."


@pytest.mark.django_db
@pytest.mark.parametrize("expiration_days", ["1", "14", "3000"], ids=lambda n: f"expiration_days ({n})")
@pytest.mark.parametrize(
"expiration_reenrollment_days", ["1", "14", "3000"], ids=lambda n: f"expiration_reenrollment_days ({n})"
)
def test_EligibilityTypeForm_supports_expiration_True_valid(expiration_days, expiration_reenrollment_days):
form_data = eligibility_type_form_data(
supports_expiration=True, expiration_days=expiration_days, expiration_reenrollment_days=expiration_reenrollment_days
)
form = EligibilityTypeForm(form_data)

assert form.is_valid()

0 comments on commit e3a2c13

Please sign in to comment.