-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
86 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,2 @@ | ||
[ | ||
{ | ||
"active": false, | ||
"code": "F383", | ||
"date_created": "1928-05-12T00:00:00", | ||
"date_deleted": "1991-12-09T00:00:00", | ||
"name": "Monserrato", | ||
"name_alt": "", | ||
"name_alt_trans": "", | ||
"name_slugs": [ | ||
"monserrato" | ||
], | ||
"name_trans": "Monserrato", | ||
"province": "CA" | ||
}, | ||
{ | ||
"active": false, | ||
"code": "F469", | ||
"date_created": "1929-06-02T00:00:00", | ||
"date_deleted": "1946-07-01T00:00:00", | ||
"name": "Montechiaro D'Acqui", | ||
"name_alt": "", | ||
"name_alt_trans": "", | ||
"name_slugs": [ | ||
"montechiaro-d-acqui" | ||
], | ||
"name_trans": "Montechiaro D'Acqui", | ||
"province": "AL" | ||
}, | ||
{ | ||
"active": false, | ||
"code": "G133", | ||
"date_created": "1928-11-28T00:00:00", | ||
"date_deleted": "1948-04-07T00:00:00", | ||
"name": "Ortacesus", | ||
"name_alt": "", | ||
"name_alt_trans": "", | ||
"name_slugs": [ | ||
"ortacesus" | ||
], | ||
"name_trans": "Ortacesus", | ||
"province": "CA" | ||
}, | ||
{ | ||
"active": false, | ||
"code": "H059", | ||
"date_created": "1929-03-26T00:00:00", | ||
"date_deleted": "1947-03-29T00:00:00", | ||
"name": "Priero", | ||
"name_alt": "", | ||
"name_alt_trans": "", | ||
"name_slugs": [ | ||
"priero" | ||
], | ||
"name_trans": "Priero", | ||
"province": "CN" | ||
}, | ||
{ | ||
"active": false, | ||
"code": "L513", | ||
"date_created": "1927-11-04T00:00:00", | ||
"date_deleted": "1946-02-27T00:00:00", | ||
"name": "Ussaramanna", | ||
"name_alt": "", | ||
"name_alt_trans": "", | ||
"name_slugs": [ | ||
"ussaramanna" | ||
], | ||
"name_trans": "Ussaramanna", | ||
"province": "CA" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import datetime | ||
import unittest | ||
|
||
from codicefiscale import codicefiscale | ||
|
||
|
||
class Issue0162TestCase(unittest.TestCase): | ||
def test_issue_0162(self): | ||
""" | ||
Wrong birthplace code error (missing date-range in the data-source). | ||
""" | ||
self.maxDiff = None | ||
code = "DFLNTN42T20B860H" | ||
self.assertTrue(codicefiscale.is_valid(code)) | ||
code_data = codicefiscale.decode(code) | ||
code_data.pop("omocodes") | ||
# print(code_data) | ||
expected_code_data = { | ||
"code": "DFLNTN42T20B860H", | ||
"gender": "M", | ||
"birthdate": datetime.datetime(1942, 12, 20, 0, 0), | ||
"birthplace": { | ||
"active": False, | ||
"code": "B860", | ||
"date_created": "1927-01-12T00:00:00", | ||
"date_deleted": "1928-06-27T00:00:00", | ||
"name": "Casagiove", | ||
"name_alt": "", | ||
"name_alt_trans": "", | ||
"name_slugs": ["casagiove"], | ||
"name_trans": "Casagiove", | ||
"province": "NA", | ||
}, | ||
"raw": { | ||
"code": "DFLNTN42T20B860H", | ||
"lastname": "DFL", | ||
"firstname": "NTN", | ||
"birthdate": "42T20", | ||
"birthdate_year": "42", | ||
"birthdate_month": "T", | ||
"birthdate_day": "20", | ||
"birthplace": "B860", | ||
"cin": "H", | ||
}, | ||
} | ||
self.assertEqual(code_data, expected_code_data) |