Skip to content
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

Fix: Implement unit tests and a model validator for the PaymentInfo pydantic model #1218

Open
Sulai-maan opened this issue Mar 2, 2025 · 1 comment

Comments

@Sulai-maan
Copy link

Sulai-maan commented Mar 2, 2025

Describe the solution you'd like

Implement unit tests and extra validators for the PaymentInfo pydantic model. The data model, which is used to process card payments, currently only checks for correct card number and cvv character count, and is not covered by any unit tests. I want to implement a model validator that checks for expired cards - so we don't call payment processor APIs with expired cards - and write unit tests for the model.

Acceptance Criteria

  • Model rejects expired cards and rasises an error
  • Unit tests cover all field and model validators

Testing Requirements
Unit Tests:

  • Write and run unit tests to validate input data.
    Integration Tests:
  • Ensure end-to-end functionality is tested with integration tests.
@Sulai-maan
Copy link
Author

@joboy-dev I'm creating this issue for my PR which was closed. The related issue I mentioned on the PR was only related to, and not exactly for it. I'd appreciate a quick review and (hopefully) approval.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant