def test_birth_date(self): result = extract_xls_data_from_admission(self.registration) self.assertEqual(result[IDX_COL_BIRTHDATE], self.registration.person_information.birth_date) result = extract_xls_data_from_registration(self.registration) self.assertEqual(result[IDX_COL_BIRTHDATE], self.registration.person_information.birth_date)
def test_email(self): result = extract_xls_data_from_admission(self.registration) self.assertEqual(result[IDX_COL_MAIL], self.registration.person_information.person.email) result = extract_xls_data_from_registration(self.registration) self.assertEqual(result[IDX_COL_MAIL], self.registration.person_information.person.email)
def test_upper_in_country_city(self): result = extract_xls_data_from_admission(self.registration) self.assertEqual(result[5], COUNTRY_NAME.upper()) self.assertEqual(result[7], CITY_NAME.upper()) self.assertEqual(result[8], COUNTRY_NAME.upper()) result = extract_xls_data_from_registration(self.registration) self.assertEqual(result[10], "{} - {} {} - {}".format(self.address.location, self.address.postal_code, self.address.city.upper(), COUNTRY_NAME.upper())) self.assertEqual(result[35], "{} - {} {} - {}".format(self.address.location, self.address.postal_code, self.address.city.upper(), COUNTRY_NAME.upper())) self.assertEqual(result[10], "{} - {} {} - {}".format(self.address.location, self.address.postal_code, self.address.city.upper(), COUNTRY_NAME.upper()))
def extract_xls_data_from_archive(archive): return extract_xls_data_from_registration(archive)
def prepare_xls_content(registrations_list): return [ extract_xls_data_from_registration(registration) for registration in registrations_list ]