Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions test_team_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ def test_us_bank_number(self):

def test_es_nif(self):
"""Test es_nif functionality"""
#Negative Testcase Should not replace id
test_string = "documento nacional de identidad B112345267A8A"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible can you provide comments for the code since it is in spanish.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the regex used to detect a valid identifier

expected = "documento nacional de identidad B112345267A8A"
self.assertEqual(expected, anonymize_text(test_string, ['ES_NIF']))
# positive testcase should replace id, does not however
test_string = 'documento nacional de identidad 123452675A'
expected = 'documento nacional de identidad <ES_NIF>'
actual = anonymize_text(test_string, ['ES_NIF'])
self.assertEqual(expected, actual)

def test_it_identity_card(self):
"""Test it_identity_card functionality"""
Expand Down