summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-14 17:49:11 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-03-14 17:49:11 +0100
commit037f06b038ac3deb8c5d87c94455241cfa58f05c (patch)
treee9ba4737b6cbf07b04b8d1b1e6f938e71f77f4b4 /archaeological_operations/tests.py
parente9e03493f014a9374838d4a57ce8b995c753b6b6 (diff)
downloadIshtar-037f06b038ac3deb8c5d87c94455241cfa58f05c.tar.bz2
Ishtar-037f06b038ac3deb8c5d87c94455241cfa58f05c.zip
Test import of files with exotic encoding (refs #3513)
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 1b64f581d..52a14ce44 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -57,11 +57,11 @@ class ImportTest(object):
tg.is_set = True
tg.save()
- def init_ope_import(self):
+ def init_ope_import(self, filename='MCC-operations-example.csv'):
mcc_operation = ImporterType.objects.get(name=u"MCC - Opérations")
mcc_operation_file = open(
settings.ROOT_PATH +
- '../archaeological_operations/tests/MCC-operations-example.csv',
+ '../archaeological_operations/tests/' + filename,
'rb')
file_dict = {'imported_file': SimpleUploadedFile(
mcc_operation_file.name, mcc_operation_file.read())}
@@ -209,6 +209,9 @@ class ImportOperationTest(ImportTest, TestCase):
self.assertEqual(last_ope,
models.Operation.objects.order_by('-pk').all()[0])
+ def test_import_bad_encoding(self):
+ self.init_ope_import('MCC-operations-example-bad-encoding.csv')
+
def test_keys_limitation(self):
# each key association is associated to the import
init_ope_number = models.Operation.objects.count()