diff options
author | Thomas André <thomas.andre@iggdrasil.net> | 2025-04-14 08:42:38 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-07-29 08:49:03 +0200 |
commit | af13ebbe3d2314cef33bd8f9e372f62518db4465 (patch) | |
tree | b0078ec33a98b60862c966cab4e8d5c48f2ddd54 /ishtar_common | |
parent | e027200e47ed93b25e2cca5f3392ba7879ad69a1 (diff) | |
download | Ishtar-af13ebbe3d2314cef33bd8f9e372f62518db4465.tar.bz2 Ishtar-af13ebbe3d2314cef33bd8f9e372f62518db4465.zip |
First tests for the uses of QField project with Ishtar datas and their importation
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/tests.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 7582bf163..8d3fd837a 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -2728,6 +2728,25 @@ class BaseImportTest(TestCase): imp_media = SimpleUploadedFile(imp.name, imp.read()) return imp_group, imp_file, imp_media + def get_qfield_import(self): + """ + :function: Reproduction of the get_group_import function, adapted for QField data + """ + # Creation of path to tests + root = os.path.join(settings.LIB_BASE_PATH, "archaeological_finds", "tests") + self.root = root + # Path to zip + importer_filename = os.path.join(root, "qfield-importeur-test.zip") + restore_serialized(importer_filename) + imp_group = models.ImporterGroup.objects.get(slug="qfield-csv-test") # Must change the name !!! + # Opening of the csv + with open(os.path.join(root, "qfield-importeur-data.csv"), "rb") as imp: + imp_file = SimpleUploadedFile(imp.name, imp.read()) + # Opening of the media + with open(os.path.join(root, "qfield-importeur-images.zip"), "rb") as imp: + imp_media = SimpleUploadedFile(imp.name, imp.read()) + return imp_group, imp_file, imp_media + def create_group_import(self, init=True): imp_group, imp_file, imp_media = self.get_group_import() create_user() |