Skip to content

Commit

Permalink
CURP as a property (#92)
Browse files Browse the repository at this point in the history
* CURP as a property

* Versions
  • Loading branch information
andreshndz authored Jun 23, 2022
1 parent 4e2cc80 commit fa0c450
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions mati/types/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ def full_name(self) -> str:
return self.fields['full_name']['value']
return ''

@property
def curp(self) -> str:
"""
This property fills the CURP direct from the ocr fields `curp`
"""
if self.fields and 'curp' in self.fields:
return self.fields['curp']['value']
return ''


@dataclass
class LivenessMedia:
Expand Down
2 changes: 1 addition & 1 deletion mati/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.3.3' # pragma: no cover
__version__ = '0.3.4' # pragma: no cover
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pytest==6.2.*
pytest-cov==2.11.*
black==20.8b1
black==22.3.0
isort==5.7.*
flake8==3.8.*
mypy==0.790
Expand Down
2 changes: 2 additions & 0 deletions tests/resources/test_verifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ def test_retrieve_full_verification(client: Client):
assert govt.document_type == 'dni'
assert govt.address == 'Varsovia 36, 06600 CDMX'
assert govt.full_name == 'FIRST LAST'
assert govt.curp == 'CURP'
govt.fields = {}
assert not govt.address
assert not govt.full_name
assert not govt.curp
assert verification.govt_id_validation.is_valid
assert verification.proof_of_life_validation.is_valid
assert verification.proof_of_residency_validation.is_valid
Expand Down

0 comments on commit fa0c450

Please sign in to comment.