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-25 10:15:33 +0100 |
| commit | 53b408380649f39880763b35a2a9d24eb7cc014a (patch) | |
| tree | 4a932ebc46229239d7bcb9e21f36ce84efa969c9 /archaeological_operations/tests.py | |
| parent | 13e838988e0a32e0ef54c15d90c8df2f92dad853 (diff) | |
| download | Ishtar-53b408380649f39880763b35a2a9d24eb7cc014a.tar.bz2 Ishtar-53b408380649f39880763b35a2a9d24eb7cc014a.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 3621469ef..b239b789d 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") with open( settings.LIB_BASE_PATH + "archaeological_operations/tests/" + filename, @@ -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] |
