def test_file_format(self, csv_string): populate_sdn_fallback_data_and_metadata(csv_string) records = SDNFallbackData.get_current_records_and_filter_by_source_and_type('Specially Designated Nationals (SDN) - Treasury Department', 'Individual') self.assertEqual(len(records), 1) self.assertEqual(process_text(records.first().names), process_text('Victor Conrad Wendy Brock')) self.assertEqual(process_text(records.first().addresses), process_text('17472 Christie Stream Apt. 976 North Kristinaport, HI 91033, SN')) self.assertEqual(records.first().countries, 'SN')
def test_process_text_unicode(self, text, expected_output): """ Verify that characters with accents are transliterated correctly and non-transliterable characters are passed through.""" output = process_text(text) self.assertEqual(output, expected_output)
def test_process_text(self, text, expected_output): """ Verify that processing text works as expected (this function is used for names and addresses) """ output = process_text(text) self.assertEqual(output, expected_output)