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
commit82e5afb0fbc7f2654cdc9e84d9668a38df2a2672 (patch)
treee9ba4737b6cbf07b04b8d1b1e6f938e71f77f4b4 /archaeological_operations/tests.py
parent97f3da30f9385a952681e315c3561671fcb1d259 (diff)
downloadIshtar-82e5afb0fbc7f2654cdc9e84d9668a38df2a2672.tar.bz2
Ishtar-82e5afb0fbc7f2654cdc9e84d9668a38df2a2672.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()