コード例 #1
0
ファイル: test_sdn.py プロジェクト: shivajeesharma/ecommerce
 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')
コード例 #2
0
ファイル: test_sdn.py プロジェクト: raccoongang/ecommerce
 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)
コード例 #3
0
ファイル: test_sdn.py プロジェクト: raccoongang/ecommerce
 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)