summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 5661e8505..5db358e63 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -182,6 +182,17 @@ class ImportTest(BaseImportTest):
tg.save()
def init_ope_import(self, filename="MCC-operations-example.csv", sep=","):
+ add = (
+ ("fouille-programmée", models.OperationType, "prog_excavation"),
+ # ("age-du-fer", models.Period, "iron-age"),
+ )
+ add = []
+ for key, model, txt_idx in add:
+ ItemKey.objects.get_or_create(
+ key=key,
+ content_type=ContentType.objects.get_for_model(model),
+ object_id=model.objects.get(txt_idx=txt_idx).pk
+ )
mcc_operation = ImporterType.objects.get(name="MCC - Opérations")
mcc_operation_file = open(
settings.LIB_BASE_PATH + "archaeological_operations/tests/" + filename, "rb"
@@ -226,7 +237,8 @@ class ImportTest(BaseImportTest):
target.save()
# target for all users
- tgs = list(TargetKey.objects.filter(key="gallo-romain").all())
+ q = TargetKey.objects.filter(key="gallo-romain")
+ tgs = list(q.all())
for tg in tgs[1:]:
tg.delete()
target2 = tgs[0]