diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-02-24 15:16:56 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-02-24 16:45:50 +0100 |
| commit | c777bc28a9cc0972a8c9d8abd18f6a2024b70857 (patch) | |
| tree | e82f98201490b900881599f0db443e695c69d1ef /archaeological_operations/tests.py | |
| parent | 9c7b8c1af2ada539608b2a07fde1c5f9f8323338 (diff) | |
| download | Ishtar-c777bc28a9cc0972a8c9d8abd18f6a2024b70857.tar.bz2 Ishtar-c777bc28a9cc0972a8c9d8abd18f6a2024b70857.zip | |
♻️ imports: simplify, refactor and clean
Diffstat (limited to 'archaeological_operations/tests.py')
| -rw-r--r-- | archaeological_operations/tests.py | 14 |
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] |
