def test_AM_FR_01_I3_nombres_apellido(self): ar = AccessRequest(id_document="12345678Z", full_name="Beatriz x Benitez", access_type="Guest", email_address="*****@*****.**", validity=3)
def test_AM_FR_01_I3_espacio_detras(self): with self.assertRaises(AccessManagementException) as AME: AccessRequest(id_document="12345678Z", full_name="Beatriz Benitez ", access_type="Guest", email_address="*****@*****.**", validity=3) self.assertEqual(AME.exception.message, AccessRequest.MENSAJE_EXCEPCION_NAME)
def test_AM_FR_01_O2_access_type(self): with self.assertRaises(AccessManagementException) as AME: ar = AccessRequest(id_document="12345678Z", full_name="Beatriz Benitez", access_type="Other", email_address="*****@*****.**", validity=3) self.assertEqual(AME.exception.message, AccessRequest.MENSAJE_EXCEPCION_ACCESS_TYPE)
def test_AM_FR_01_I3_nombre_apellido(self): ar = AccessRequest(id_document="12345678Z", full_name="Beatriz Benitez", access_type="Guest", email_address="*****@*****.**", validity=3) self.assertEqual(ar.access_code, "299350376deadf07044aaa5035f93a6f")
def test_AM_FR_01_I5_validity_resident_2(self): with self.assertRaises(AccessManagementException) as AME: AccessRequest(id_document="12345678Z", full_name="Beatriz Benitez", access_type="Resident", email_address="*****@*****.**", validity=2) self.assertEqual(AME.exception.message, AccessRequest.MENSAJE_EXCEPCION_VALIDITY)
def test_AM_FR_01_O1_invalido(self): ar = AccessRequest(id_document="12345678Z", full_name="Beatriz Benitez", access_type="Guest", email_address="*****@*****.**", validity=3) self.assertNotEqual(ar.access_code, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
def test_AM_FR_01_I5_validity_resident_0(self): ar = AccessRequest(id_document="12345678Z", full_name="Beatriz Benitez", access_type="Resident", email_address="*****@*****.**", validity=0) self.assertEqual(ar.access_code, "eeadab980b4ae41412aed7a991750fab")
def test_AM_FR_01_I5_validity_guest_15(self): ar = AccessRequest(id_document="12345678Z", full_name="Beatriz Benitez", access_type="Guest", email_address="*****@*****.**", validity=15) self.assertEqual(ar.access_code, "e5148debcfde73b070d3bc94849a0834")
def test_AM_FR_01_I5_validity_guest_14(self): ar = AccessRequest(id_document="12345678Z", full_name="Beatriz Benitez", access_type="Guest", email_address="*****@*****.**", validity=14) self.assertEqual(ar.access_code, "2c3332d44cc5ef4c63af11fefd9b4f18")
def test_AM_FR_01_I5_validity_guest_2(self): ar = AccessRequest(id_document="12345678Z", full_name="Beatriz Benitez", access_type="Guest", email_address="*****@*****.**", validity=2) self.assertEqual(ar.access_code, "4bbd21090fb63e6810eb67adc3fcdcee")
def test_AM_FR_01_I4_email_sin_company(self): with self.assertRaises(AccessManagementException) as AME: AccessRequest(id_document="12345678Z", full_name="Beatriz Benitez", access_type="Guest", email_address="[email protected]", validity=3) self.assertEqual(AME.exception.message, AccessRequest.MENSAJE_EXCEPCION_EMAIL)