Repository: identique/idnumbers (language: python)

Issue:
[NationalID] Croatia TIN
## basic data
* Country ISO-3166 code: HRV
* Links to National IDs
    * TIN: check file at #239  




Discussion / hints:

Fix patch:
diff --git a/idnumbers/nationalid/HRV.py b/idnumbers/nationalid/HRV.py
index 15520be9..7b15fa59 100644
--- a/idnumbers/nationalid/HRV.py
+++ b/idnumbers/nationalid/HRV.py
@@ -1,7 +1,7 @@
+from types import SimpleNamespace
 from .hrv.personal_id import PersonalID
 from .util import alias_of
 
-
 NationalID = alias_of(PersonalID)
 """
 alias of PersonalID
@@ -10,3 +10,15 @@
 """
 alias of PersonalID
 """
+PIN = alias_of(PersonalID)
+"""
+alias of PersonalID
+"""
+TIN = SimpleNamespace(**{
+    'individual': PersonalID,
+    'entity': PersonalID
+})
+"""
+According to the doc in https://www.porezna-uprava.hr/en/Pages/PIN.aspx, we know the TIN for individual and entity are
+the same.
+"""
diff --git a/idnumbers/nationalid/hrv/personal_id.py b/idnumbers/nationalid/hrv/personal_id.py
index b972103a..6d1148e1 100644
--- a/idnumbers/nationalid/hrv/personal_id.py
+++ b/idnumbers/nationalid/hrv/personal_id.py
@@ -19,8 +19,10 @@ class PersonalID:
         'alias_of': None,
         'names': ['Personal ID Number',
                   'Osobni identifikacijski broj',
-                  'OIB'],
-        'links': ['https://en.wikipedia.org/wiki/Personal_identification_number_(Croatia)'],
+                  'OIB',
+                  'PIN'],
+        'links': ['https://en.wikipedia.org/wiki/Personal_identification_number_(Croatia)',
+                  'https://www.porezna-uprava.hr/en/Pages/PIN.aspx'],
         'deprecated': False
 
     })


Test patch:
diff --git a/tests/nationalid/test_HRV.py b/tests/nationalid/test_HRV.py
index 2fc1c502..a02f4391 100644
--- a/tests/nationalid/test_HRV.py
+++ b/tests/nationalid/test_HRV.py
@@ -1,4 +1,4 @@
-from unittest import TestCase, main
+from unittest import TestCase
 from idnumbers.nationalid import HRV
 
 
@@ -11,6 +11,6 @@ def test_error_case(self):
         self.assertFalse(HRV.PersonalID.validate('6943515153'))
         self.assertFalse(HRV.PersonalID.validate('69435151531'))
 
-
-if __name__ == '__main__':
-    main()
+    def test_tin_cases(self):
+        self.assertTrue(HRV.TIN.individual.validate('94577403194'))
+        self.assertTrue(HRV.TIN.entity.validate('23961056387'))