add pasword reset request model#402
Conversation
… validation tests
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #402 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 1464 1466 +2
=========================================
+ Hits 1464 1466 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_requests.py`:
- Line 1: Remove the unit tests that assert Pydantic's built-in Coordinate
validation internals: delete the parameter cases named "missing_location" and
"bad_coordinate" from the pytest parametrization (or delete the small test block
that only checks Coordinate validation) in tests/test_requests.py so the suite
no longer contains tests specifically targeting Pydantic's built-in validators;
retain any other assertions that test your own code paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 06a0deaf-049c-4ad6-ad0d-90f75b7d257c
📒 Files selected for processing (4)
cuenca_validations/types/__init__.pycuenca_validations/types/requests.pycuenca_validations/version.pytests/test_requests.py
…setRequest, and adjust related tests accordingly
bf18fd6 to
8a4c897
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
tests/test_requests.py (1)
41-49:⚠️ Potential issue | 🟠 Major | ⚡ Quick winRemove this
Coordinateserialization test; it validates library internals, not app logic.This test asserts
pydantic_extra_types.coordinate.Coordinateserialization behavior (latitude/longitude) rather than repository-owned behavior.Proposed minimal change
-def test_password_reset_request_serializes() -> None: - payload: DictStrAny = {'location': (19.432607, -99.133209)} - req = PasswordResetRequest.model_validate(payload) - assert req.model_dump() == { - 'location': { - 'latitude': 19.432607, - 'longitude': -99.133209, - }, - }#!/bin/bash # Verify this suite is not asserting Coordinate internals directly. rg -n --type=py -C2 "latitude|longitude|PasswordResetRequest\.model_validate\(" testsAs per coding guidelines, "Do not write unit tests specifically for validating the behavior of Pydantic's built-in validators... Remove unnecessary unit tests that only validate built-in Pydantic validation behavior."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_requests.py` around lines 41 - 49, Remove or modify the test_password_reset_request_serializes test so it does not assert pydantic_extra_types.coordinate.Coordinate internals (latitude/longitude); instead verify only repository-owned behavior such as that PasswordResetRequest.model_validate(payload) produces a model with a 'location' field (or simply remove the test entirely). Locate the test function test_password_reset_request_serializes and either delete it or change its assertions to check for presence/type of 'location' on the PasswordResetRequest instance without asserting specific 'latitude'/'longitude' serialization.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@tests/test_requests.py`:
- Around line 41-49: Remove or modify the test_password_reset_request_serializes
test so it does not assert pydantic_extra_types.coordinate.Coordinate internals
(latitude/longitude); instead verify only repository-owned behavior such as that
PasswordResetRequest.model_validate(payload) produces a model with a 'location'
field (or simply remove the test entirely). Locate the test function
test_password_reset_request_serializes and either delete it or change its
assertions to check for presence/type of 'location' on the PasswordResetRequest
instance without asserting specific 'latitude'/'longitude' serialization.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b6e32058-ee2c-4c86-8b6a-e6d32f891587
📒 Files selected for processing (3)
cuenca_validations/types/requests.pycuenca_validations/version.pytests/test_requests.py
✅ Files skipped from review due to trivial changes (1)
- cuenca_validations/version.py
🚧 Files skipped from review as they are similar to previous changes (1)
- cuenca_validations/types/requests.py
| @@ -1 +1 @@ | |||
| __version__ = '2.1.30' | |||
| __version__ = '2.1.31.dev1' | |||
Summary by CodeRabbit
New Features
Tests
Chores