Skip to content

Commit

Permalink
Remove incorrect implementation of doi for en_ES locale
Browse files Browse the repository at this point in the history
  • Loading branch information
fcurella committed Mar 7, 2025
1 parent 35445be commit f628ddc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
11 changes: 3 additions & 8 deletions faker/providers/ssn/es_ES/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,13 @@ def cif(self) -> str:
cif = first_chr + doi_body
return cif + self._calculate_control_cif(cif)

def doi(self) -> str:
"""
https://es.wikipedia.org/wiki/Identificador_de_objeto_digital
:return: a random Spanish CIF or NIE or NIF
"""

return random.choice([self.cif, self.nie, self.nif])()

def nuss(self, company: bool = False) -> str:
"""
:param company: flag to indicate if we should generate a company NUSS
:return: a random Spanish Social Security Number (Número de la Seguridad Social)
:sample:
:sample: company=True
"""
nuss_body_length = 8
if company:
Expand Down
3 changes: 0 additions & 3 deletions tests/providers/test_ssn.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,6 @@ def test_cif(self):
for _ in range(100):
assert is_cif(self.fake.cif())

def test_doi(self):
assert len(self.fake.doi()) == 9

def test_nuss(self):
for _ in range(50):
nuss = self.fake.nuss()
Expand Down

0 comments on commit f628ddc

Please sign in to comment.