def test_legal_person_nit_with_check_digit(self): for _ in range(100): legal_person_nit, check_digit = self.fake.legal_person_nit_with_check_digit( ).split("-") assert self._LEGAL_PERSON_NIT_REGEX.fullmatch(legal_person_nit) assert self._CHECK_DIGIT_REGEX.fullmatch(check_digit) assert nit_check_digit(legal_person_nit) == check_digit
def test_natural_person_nit_with_check_digit(self): for _ in range(100): natural_person_nit, check_digit = self.fake.natural_person_nit_with_check_digit( ).split("-") assert self._NATURAL_PERSON_NIT_REGEX.fullmatch(natural_person_nit) assert self._CHECK_DIGIT_REGEX.fullmatch(check_digit) assert nit_check_digit(natural_person_nit) == check_digit
def test_nit_check_digit(self): # NITs and check digits of some Colombian state entities. # Source: <https://www.funcionpublica.gov.co/web/sigep/entidades> for nit, check_digit in ( ("830040256", "0"), ("899999003", "1"), ("892301483", "2"), ("800194600", "3"), ("899999403", "4"), ("860042945", "5"), ("830114475", "6"), ("811000231", "7"), ("899999027", "8"), ("900639630", "9"), ): with self.subTest(nit=nit, check_digit=check_digit): assert nit_check_digit(nit) == check_digit