cuenca-validations 2.1.30.dev0__py3-none-any.whl → 2.1.31.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cuenca_validations/types/__init__.py +2 -0
- cuenca_validations/types/enums.py +2 -1
- cuenca_validations/types/requests.py +4 -0
- cuenca_validations/version.py +1 -1
- {cuenca_validations-2.1.30.dev0.dist-info → cuenca_validations-2.1.31.dev1.dist-info}/METADATA +1 -1
- {cuenca_validations-2.1.30.dev0.dist-info → cuenca_validations-2.1.31.dev1.dist-info}/RECORD +10 -10
- tests/test_requests.py +43 -0
- {cuenca_validations-2.1.30.dev0.dist-info → cuenca_validations-2.1.31.dev1.dist-info}/WHEEL +0 -0
- {cuenca_validations-2.1.30.dev0.dist-info → cuenca_validations-2.1.31.dev1.dist-info}/licenses/LICENSE +0 -0
- {cuenca_validations-2.1.30.dev0.dist-info → cuenca_validations-2.1.31.dev1.dist-info}/top_level.txt +0 -0
|
@@ -59,6 +59,7 @@ __all__ = [
|
|
|
59
59
|
'MonthlySpendingType',
|
|
60
60
|
'PartnerRequest',
|
|
61
61
|
'PartnerUpdateRequest',
|
|
62
|
+
'PasswordResetRequest',
|
|
62
63
|
'PhoneNumber',
|
|
63
64
|
'PlatformRequest',
|
|
64
65
|
'PlatformType',
|
|
@@ -233,6 +234,7 @@ from .requests import (
|
|
|
233
234
|
LimitedWalletRequest,
|
|
234
235
|
PartnerRequest,
|
|
235
236
|
PartnerUpdateRequest,
|
|
237
|
+
PasswordResetRequest,
|
|
236
238
|
PlatformRequest,
|
|
237
239
|
QuestionnairesRequest,
|
|
238
240
|
SavingRequest,
|
|
@@ -738,7 +738,8 @@ class IncomeType(str, Enum):
|
|
|
738
738
|
support_from_third_party = 'support_from_third_party'
|
|
739
739
|
variable = 'variable'
|
|
740
740
|
|
|
741
|
+
|
|
741
742
|
class RequiredAction(str, Enum):
|
|
742
743
|
level_up_required = 'level_up_required'
|
|
743
744
|
level_up_invitation = 'level_up_invitation'
|
|
744
|
-
fix_documents = 'fix_documents'
|
|
745
|
+
fix_documents = 'fix_documents'
|
|
@@ -455,6 +455,10 @@ class UserTOSAgreementRequest(BaseRequest):
|
|
|
455
455
|
signature_image_url: Optional[FileCuencaUrl] = None
|
|
456
456
|
|
|
457
457
|
|
|
458
|
+
class PasswordResetRequest(BaseRequest):
|
|
459
|
+
location: Coordinate
|
|
460
|
+
|
|
461
|
+
|
|
458
462
|
class UserRequest(BaseRequest):
|
|
459
463
|
curp: Curp = Field(
|
|
460
464
|
description=(
|
cuenca_validations/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '2.1.
|
|
1
|
+
__version__ = '2.1.31.dev1'
|
{cuenca_validations-2.1.30.dev0.dist-info → cuenca_validations-2.1.31.dev1.dist-info}/RECORD
RENAMED
|
@@ -4,27 +4,27 @@ cuenca_validations/errors.py,sha256=OtM8EgiKqYdz9Hn66AbBO96orL1or7efkyt0vh0Zxbs,
|
|
|
4
4
|
cuenca_validations/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
cuenca_validations/typing.py,sha256=1QCu81IbVZZpyInjyeAuO-nF36gpT5Gi4o6V9PozuOU,204
|
|
6
6
|
cuenca_validations/validators.py,sha256=zXSnU5-EMbQZBD-PfFXgP4Z6G7cm7KFDWXB7Nie6WUk,2682
|
|
7
|
-
cuenca_validations/version.py,sha256=
|
|
8
|
-
cuenca_validations/types/__init__.py,sha256=
|
|
7
|
+
cuenca_validations/version.py,sha256=XkU16FsSKKjz0G9A4S-b9cWBXeznI_yz9kVIlEuDcs0,28
|
|
8
|
+
cuenca_validations/types/__init__.py,sha256=llL7obyGbxbwmcyiSXX9ZZ5P1REbD9H2tOP34klwKYE,5519
|
|
9
9
|
cuenca_validations/types/card.py,sha256=UGzz8NTFAverUmdUKAK1oGHnOnjSNTpIRUm93vKSSGY,1295
|
|
10
|
-
cuenca_validations/types/enums.py,sha256=
|
|
10
|
+
cuenca_validations/types/enums.py,sha256=f-qMUdxLZsAqRvEwh3EcUsB2K-loufvPzdcK0JFQ1JY,20586
|
|
11
11
|
cuenca_validations/types/files.py,sha256=2CszbwF9ytXV9suFFwyDjYG4XxY8UhCjRw3HttVXXNw,269
|
|
12
12
|
cuenca_validations/types/general.py,sha256=eYFYwyx_a4_J480GYpqW3DFbZabDFcUjvLRMQbShIUc,5622
|
|
13
13
|
cuenca_validations/types/helpers.py,sha256=4veeLZbugHHqZk0ezSim978VhH6Vq8XTrEhe1eE_r3A,1531
|
|
14
14
|
cuenca_validations/types/identities.py,sha256=j2xxh3UYHJe6IbAwr9yNXJkebTth_-g3SUmHeiPez8M,5513
|
|
15
15
|
cuenca_validations/types/morals.py,sha256=davabh5hAnFVQyM7-yCyDaT5ewXnm0cr1BtqDIwzkX8,1833
|
|
16
16
|
cuenca_validations/types/queries.py,sha256=iVr6Z8ahXon0rlqQLu7aqRY6WtRxkN-1C7A2zeVt2-4,5314
|
|
17
|
-
cuenca_validations/types/requests.py,sha256=
|
|
18
|
-
cuenca_validations-2.1.
|
|
17
|
+
cuenca_validations/types/requests.py,sha256=DZOxi1fWgruUvxt-3nNLKiV4IyiG7sG__pp_pl356dc,24064
|
|
18
|
+
cuenca_validations-2.1.31.dev1.dist-info/licenses/LICENSE,sha256=wR76FmxBbfnQpwELkkE5iMF8sFIafEMgXLTE4N4WPTc,1063
|
|
19
19
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
tests/test_card.py,sha256=QAfRz7e11gWICPnFJZ2tiYgUsFV3C9TwzJXrDnDNXFw,1202
|
|
21
21
|
tests/test_errors.py,sha256=ixiIgEuBuzfsL5p4uCFdF32XqFRtTPF6EVhGJ0keOrI,930
|
|
22
22
|
tests/test_helpers.py,sha256=fx2R7y6oQO8XeQzevJe826NuHkBgvtznZicomchB3Gg,899
|
|
23
|
-
tests/test_requests.py,sha256=
|
|
23
|
+
tests/test_requests.py,sha256=0ERUPtTZz9ST1dMZM_Dm21BbyJQGN_elGR5pvJ_TE2w,3763
|
|
24
24
|
tests/test_statement.py,sha256=IOE0rRRBgBZSJv_FLaETEyn5NzzXKMNTqgjv99GX-68,1436
|
|
25
25
|
tests/test_types.py,sha256=_gaLCEH-P_C6hC-NuIDwHmjReVspD6cpG6TtGlj5aec,21435
|
|
26
26
|
tests/test_validators.py,sha256=Jjr9gWTT4cRntGiKvQK4fncqx3JkEuTWkKm1VqpRHTs,1829
|
|
27
|
-
cuenca_validations-2.1.
|
|
28
|
-
cuenca_validations-2.1.
|
|
29
|
-
cuenca_validations-2.1.
|
|
30
|
-
cuenca_validations-2.1.
|
|
27
|
+
cuenca_validations-2.1.31.dev1.dist-info/METADATA,sha256=ToRsDABRN4qM8-RHY-1ANipMGA_gG1XtxrNuC-ozHDs,1600
|
|
28
|
+
cuenca_validations-2.1.31.dev1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
29
|
+
cuenca_validations-2.1.31.dev1.dist-info/top_level.txt,sha256=4233xdOs2HtuT-GFRjcDcwK0IwdwvWdczOtk0fPB6Gw,25
|
|
30
|
+
cuenca_validations-2.1.31.dev1.dist-info/RECORD,,
|
tests/test_requests.py
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
import pytest
|
|
2
4
|
from pydantic import ValidationError
|
|
3
5
|
from pydantic_extra_types.phone_numbers import PhoneNumber
|
|
4
6
|
|
|
5
7
|
from cuenca_validations.types.enums import VerificationType
|
|
6
8
|
from cuenca_validations.types.requests import (
|
|
9
|
+
PasswordResetRequest,
|
|
7
10
|
UserTOSAgreementRequest,
|
|
8
11
|
UserUpdateRequest,
|
|
9
12
|
VerificationRequest,
|
|
@@ -37,6 +40,46 @@ def test_file_cuenca_url_invalid() -> None:
|
|
|
37
40
|
UserTOSAgreementRequest(**request_data)
|
|
38
41
|
|
|
39
42
|
|
|
43
|
+
_VALID_COORDINATE = (19.432607, -99.133209)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@pytest.mark.parametrize(
|
|
47
|
+
('payload', 'expected_dump'),
|
|
48
|
+
[
|
|
49
|
+
pytest.param(
|
|
50
|
+
{'location': _VALID_COORDINATE},
|
|
51
|
+
{
|
|
52
|
+
'location': {
|
|
53
|
+
'latitude': 19.432607,
|
|
54
|
+
'longitude': -99.133209,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
id='serializes',
|
|
58
|
+
),
|
|
59
|
+
pytest.param(
|
|
60
|
+
{},
|
|
61
|
+
None,
|
|
62
|
+
id='missing_location',
|
|
63
|
+
),
|
|
64
|
+
pytest.param(
|
|
65
|
+
{'location': (91.0, 0.0)},
|
|
66
|
+
None,
|
|
67
|
+
id='bad_coordinate',
|
|
68
|
+
),
|
|
69
|
+
],
|
|
70
|
+
)
|
|
71
|
+
def test_password_reset_request(
|
|
72
|
+
payload: DictStrAny,
|
|
73
|
+
expected_dump: Optional[DictStrAny],
|
|
74
|
+
) -> None:
|
|
75
|
+
if expected_dump is None:
|
|
76
|
+
with pytest.raises(ValidationError):
|
|
77
|
+
PasswordResetRequest.model_validate(payload)
|
|
78
|
+
else:
|
|
79
|
+
req = PasswordResetRequest.model_validate(payload)
|
|
80
|
+
assert req.model_dump() == expected_dump
|
|
81
|
+
|
|
82
|
+
|
|
40
83
|
def test_update_user_requires_at_least_one_param():
|
|
41
84
|
with pytest.raises(ValueError) as ex:
|
|
42
85
|
UserUpdateRequest()
|
|
File without changes
|
|
File without changes
|
{cuenca_validations-2.1.30.dev0.dist-info → cuenca_validations-2.1.31.dev1.dist-info}/top_level.txt
RENAMED
|
File without changes
|