summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-10-17 16:53:13 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2024-04-16 16:38:32 +0200
commit901b0782a01310102665824dd945ee427b0df6b7 (patch)
treeff682e226c0f52e4f63fac27377f991f2d52212d
parentc8eaf955e0ce92c14380aa13fad66a6b3354c3dd (diff)
downloadIshtar-901b0782a01310102665824dd945ee427b0df6b7.tar.bz2
Ishtar-901b0782a01310102665824dd945ee427b0df6b7.zip
✅ fix group importer tests
-rw-r--r--archaeological_finds/tests.py2
-rw-r--r--archaeological_finds/tests/importer-group.csv2
-rw-r--r--ishtar_common/tests.py8
3 files changed, 9 insertions, 3 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py
index 202452ef8..c73aff9ae 100644
--- a/archaeological_finds/tests.py
+++ b/archaeological_finds/tests.py
@@ -729,7 +729,7 @@ class ImportFindTest(ImportTest, FindInit, TestCase):
self.assertEqual(models.BaseFind.objects.count(), nb_base_find + 1)
self.assertEqual(models.Find.objects.count(), nb_find + 1)
- self.assertEqual(Container.objects.count(), nb_container + 3) # 1 new container + 2 divisions
+ self.assertEqual(Container.objects.count(), nb_container + 3) # 1 new container + 2 divisions
self.assertEqual(Document.objects.count(), nb_docs + 1)
self.assertFalse(any(imp.error_file for imp in impt.imports.all()), msg="Error on group import")
diff --git a/archaeological_finds/tests/importer-group.csv b/archaeological_finds/tests/importer-group.csv
index ca4d08b6e..5743d3892 100644
--- a/archaeological_finds/tests/importer-group.csv
+++ b/archaeological_finds/tests/importer-group.csv
@@ -1,2 +1,2 @@
Référence contenant,Type de contenant,Localisation 1,Localisation 2,Localisation 3,Localisation 4,Localisation 5,Localisation 6,Code opération,INSEE,Section de parcellaire,Numéro de parcelle,Identifiant UE,Identifiant objet ou lot,Identifiant précédent,Lot ou objet,Matériau(x),Type(s) d’objet(s),Description,Nombre,Poids (g.),Etat sanitaire,Types d'altération,Causes d'altération,Type de traitement recommandé,Urgence du traitement,Commentaire dur la conservation,Intégrité/intérêt,Remarquabilité,Date de découverte,Marquage,Localisation topographique,Commentaire général,Chronologie,CCE/dépôt concerné,Image,Identifiant document
-WARH002000,CT,123,456,,,,,123456,59350,AK,1,US0007,123456-US0007-00001,,Lot,céramique,vaisselle,,,800,stable,,,,,,,Oui,01/07/1997,non marqués,,ancien contenant 42,,warh,test.png,test-jpg
+WARH002000,CT,123,456,,,,,123456,59355,AK,1,US0007,123456-US0007-00001,,Lot,céramique,vaisselle,,,800,stable,,,,,,,Oui,01/07/1997,non marqués,,ancien contenant 42,,warh,test.png,test-jpg
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 257036556..979b38395 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -875,6 +875,12 @@ class SerializationTest(GenericSerializationTest, TestCase):
models.ValueFormater.objects.create(
name="Test", slug="test", format_string="HOPS-{}"
)
+ group = models.ImporterGroup.objects.create(
+ name="Test", slug="test"
+ )
+ imp = models.ImporterType.objects.all()[0]
+ models.ImporterGroupImporter.objects.create(group=group, importer_type=imp)
+
def test_importer_serialization(self):
self.create_default_importer()
@@ -2493,7 +2499,7 @@ class BaseImportTest(TestCase):
def init_group_import(self, impt):
impt.initialize()
Town = apps.get_model("ishtar_common", "Town")
- Town.objects.get_or_create(numero_insee="59350", name="Nordweiler")
+ Town.objects.get_or_create(numero_insee="59355", name="Nordweiler")
Operation = apps.get_model("archaeological_operations", "Operation")
OperationType = apps.get_model("ishtar_common", "OperationType")
ope_type = OperationType.objects.create(