-
Notifications
You must be signed in to change notification settings - Fork 11
Refactor: simplify eligibility verification forms #3392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||
6a879b7 to
c459fb3
Compare
c459fb3 to
3a488cc
Compare
we can move the __init__ args to class attributes, following the more typical Django style for e.g. class-based views and other objects, removing the need for __init__ definitions in child form classes and reducing duplication and the amount of overrides needed additionally, we have CSTAgencyCard inherit from MSTCourtesyCard, as this is really a special case of MSTCourtesyCard used only for testing purposes
test valid and invalid data refactor EnrollmentFlowSelectionForm tests to follow the same pattern
3a488cc to
360421e
Compare
lalver1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice cleanup, it looks good to me! I also tested locally and saw no issues.
While going over the new class attributes I did notice that originally name_placeholder for CST was Hernandez-Demarcos but in this PR it becomes Garcia due to the default value of the attribute. This doesn't affect anything though so we're good 👍
|
@angela-tran I saw your 👀 on the PR description -- just checking if you wanted to review before I merge? |
That's ok, you can go ahead with merging. I've skimmed through most of the changes and didn't have any pending thoughts or anything. Thanks for checking! |
Closes #3396
__init__kwargs to class attribute for easier inheritanceReviewing
To get setup, start with the fixtures file in LastPass for Littlepay, and add the following entries:
{ "model": "core.transitagency", "pk": 2, "fields": { "active": true, "slug": "mst", "short_name": "MST (local)", "long_name": "MST (local)", "info_url": "https://www.agency-website.com", "phone": "1-800-555-5555", "eligibility_api_config": 1, "logo": "agencies/cst.png" } }, { "model": "core.transitagency", "pk": 3, "fields": { "active": true, "slug": "sbmtd", "short_name": "SBMTD (local)", "long_name": "SBMTD (local)", "info_url": "https://www.agency-website.com", "phone": "1-800-555-5555", "eligibility_api_config": 1, "logo": "agencies/cst.png" } }, { "model": "core.eligibilityapiverificationrequest", "pk": 2, "fields": { "label": "courtesy_card", "api_url": "http://server:8000/verify", "api_auth_header": "X-Server-API-Key", "api_auth_key_secret_name": "agency-card-flow-api-auth-key", "api_public_key": 1, "api_jwe_cek_enc": "A256CBC-HS512", "api_jwe_encryption_alg": "RSA-OAEP", "api_jws_signing_alg": "RS256" } }, { "model": "core.eligibilityapiverificationrequest", "pk": 3, "fields": { "label": "mobility_pass", "api_url": "http://server:8000/verify", "api_auth_header": "X-Server-API-Key", "api_auth_key_secret_name": "agency-card-flow-api-auth-key", "api_public_key": 1, "api_jwe_cek_enc": "A256CBC-HS512", "api_jwe_encryption_alg": "RSA-OAEP", "api_jws_signing_alg": "RS256" } }, { "model": "core.enrollmentflow", "pk": 6, "fields": { "system_name": "courtesy_card", "label": "Courtesy Cardholder", "display_order": 6, "api_request": 2, "supported_enrollment_methods": ["digital"], "transit_agency": 2 } }, { "model": "core.enrollmentflow", "pk": 7, "fields": { "system_name": "mobility_pass", "label": "Mobility Pass Cardholder", "display_order": 7, "api_request": 3, "supported_enrollment_methods": ["digital"], "transit_agency": 3 } },Then for each of CST, MST, and SBMTD, confirm:
/eligibilitypage/eligibility/startpage/eligibility/confirmpage shows the agency-specific form/language