def test_analysis_dni_expired(self): parser = DNIScumParser(DNI_OLD) reference_date = datetime(year=2030, month=11, day=1).date() self.assertAnalysis([parser.EXPIRED, parser.FRONT, parser.BACK], parser.analysis(person={'name': 'maria del sagrario', 'surnames': 'sanchez de la blanca puente', 'id': '56933095f'}, reference_date=reference_date))
def test_analysis_old_dni_valid(self): parser = DNIScumParser(DNI_OLD) reference_date = datetime(year=2017, month=11, day=1).date() self.assertAnalysis([parser.VALID], parser.analysis(person={'name': 'maria del sagrario', 'surnames': 'sanchez de la blanca puente', 'id': '56933095f'}, reference_date=reference_date))
def test_analysis_old_dni_valid_id_surnames(self): parser = DNIScumParser(DNI_OLD_COMPLETE_SURNAMES) reference_date = datetime(year=2017, month=11, day=1).date() self.assertAnalysis([parser.VALID], parser.analysis(person={'name': 'Jose alberto', 'surnames': 'Cort\xe9s sanz', 'id': None}, reference_date=reference_date))
def test_analysis_old_dni_valid_id_none(self): parser = DNIScumParser(DNI_OLD_ALL) reference_date = datetime(year=2017, month=11, day=1).date() self.assertAnalysis([parser.VALID], parser.analysis(person={'name': 'Clara', 'surnames': 'Abad', 'id': None}, reference_date=reference_date))
def test_analysis_keywords_not_found(self): parser = DNIScumParser(DNI_NO_KEYWORDS) self.assertAnalysis([parser.BACK], parser.analysis(person={'name': 'manuel', 'surnames': 'martinez perez', 'id': '16925657p'}))
def test_analysis_dates_not_found(self): parser = DNIScumParser(DNI_NO_DATES) self.assertAnalysis([parser.BACK], parser.analysis(person={'name': 'begoña', 'surnames': 'sanz perez', 'id': '25748789r'}))
def test_analysis_not_valid(self): parser = DNIScumParser(DNI_NOT_VALID) self.assertAnalysis([parser.NOT_VALID], parser.analysis())
def test_analysis_new_dni_not_client(self): parser = DNIScumParser(DNI_NEW) reference_date = datetime(year=2017, month=11, day=1).date() self.assertAnalysis([parser.FRONT, parser.BACK, parser.NOT_VALID_PERSON], parser.analysis(person={'name': 'luis', 'surnames': 'alvarez dorado', 'id': '14900073d'}, reference_date=reference_date))
def test_analysis_new_dni_valid_with_only_number(self): parser = DNIScumParser(DNI_NEW) reference_date = datetime(year=2017, month=11, day=1).date() self.assertAnalysis([parser.VALID], parser.analysis(person={'name': 'ramon', 'surnames': 'alvarez dorado'}, reference_date=reference_date))