diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-12-15 18:37:26 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:22 +0100 |
commit | 173db6ad38f8286db3953e5965af37b0f2d953c4 (patch) | |
tree | 803e5d2cfbf1ba8e4b4dc818027c83d8ce81516b /archaeological_operations | |
parent | 99b583ae953b71840f986f26f827f55d445594a4 (diff) | |
download | Ishtar-173db6ad38f8286db3953e5965af37b0f2d953c4.tar.bz2 Ishtar-173db6ad38f8286db3953e5965af37b0f2d953c4.zip |
Fix null -> "" errors - fix tests
Diffstat (limited to 'archaeological_operations')
-rw-r--r-- | archaeological_operations/fixtures/initial_data-fr.json | 304 | ||||
-rw-r--r-- | archaeological_operations/models.py | 2 | ||||
-rw-r--r-- | archaeological_operations/tests.py | 20 |
3 files changed, 167 insertions, 159 deletions
diff --git a/archaeological_operations/fixtures/initial_data-fr.json b/archaeological_operations/fixtures/initial_data-fr.json index 07b4290bb..e3a55c668 100644 --- a/archaeological_operations/fixtures/initial_data-fr.json +++ b/archaeological_operations/fixtures/initial_data-fr.json @@ -1728,7 +1728,7 @@ "fields": { "label": "aile", "txt_idx": "aile", - "comment": null, + "comment": "", "available": true } }, @@ -1737,7 +1737,7 @@ "fields": { "label": "aire de battage", "txt_idx": "aire-de-battage", - "comment": null, + "comment": "", "available": true } }, @@ -1746,7 +1746,7 @@ "fields": { "label": "amas", "txt_idx": "amas", - "comment": null, + "comment": "", "available": true } }, @@ -1755,7 +1755,7 @@ "fields": { "label": "amas coquillier", "txt_idx": "amas-coquillier", - "comment": null, + "comment": "", "available": true } }, @@ -1764,7 +1764,7 @@ "fields": { "label": "amas de d\u00e9bitage", "txt_idx": "amas-de-debitage", - "comment": null, + "comment": "", "available": true } }, @@ -1773,7 +1773,7 @@ "fields": { "label": "am\u00e9nagement ind\u00e9termin\u00e9", "txt_idx": "amenagement-indetermine", - "comment": null, + "comment": "", "available": true } }, @@ -1782,7 +1782,7 @@ "fields": { "label": "anomalie", "txt_idx": "anomalie", - "comment": null, + "comment": "", "available": true } }, @@ -1791,7 +1791,7 @@ "fields": { "label": "arc", "txt_idx": "arc", - "comment": null, + "comment": "", "available": true } }, @@ -1800,7 +1800,7 @@ "fields": { "label": "arcasse", "txt_idx": "arcasse", - "comment": null, + "comment": "", "available": true } }, @@ -1809,7 +1809,7 @@ "fields": { "label": "arche", "txt_idx": "arche", - "comment": null, + "comment": "", "available": true } }, @@ -1818,7 +1818,7 @@ "fields": { "label": "aula", "txt_idx": "aula", - "comment": null, + "comment": "", "available": true } }, @@ -1827,7 +1827,7 @@ "fields": { "label": "autel", "txt_idx": "autel", - "comment": null, + "comment": "", "available": true } }, @@ -1836,7 +1836,7 @@ "fields": { "label": "banquette", "txt_idx": "banquette", - "comment": null, + "comment": "", "available": true } }, @@ -1845,7 +1845,7 @@ "fields": { "label": "barbacane", "txt_idx": "barbacane", - "comment": null, + "comment": "", "available": true } }, @@ -1854,7 +1854,7 @@ "fields": { "label": "barrot", "txt_idx": "barrot", - "comment": null, + "comment": "", "available": true } }, @@ -1863,7 +1863,7 @@ "fields": { "label": "basse-cour", "txt_idx": "basse-cour", - "comment": null, + "comment": "", "available": true } }, @@ -1872,7 +1872,7 @@ "fields": { "label": "bassin", "txt_idx": "bassin", - "comment": null, + "comment": "", "available": true } }, @@ -1881,7 +1881,7 @@ "fields": { "label": "bastion", "txt_idx": "bastion", - "comment": null, + "comment": "", "available": true } }, @@ -1890,7 +1890,7 @@ "fields": { "label": "b\u00e2timent", "txt_idx": "batiment", - "comment": null, + "comment": "", "available": true } }, @@ -1899,7 +1899,7 @@ "fields": { "label": "bloc", "txt_idx": "bloc", - "comment": null, + "comment": "", "available": true } }, @@ -1908,7 +1908,7 @@ "fields": { "label": "bloc orn\u00e9", "txt_idx": "bloc-orne", - "comment": null, + "comment": "", "available": true } }, @@ -1917,7 +1917,7 @@ "fields": { "label": "bloc ouvrag\u00e9", "txt_idx": "bloc-ouvrage", - "comment": null, + "comment": "", "available": true } }, @@ -1926,7 +1926,7 @@ "fields": { "label": "boisage", "txt_idx": "boisage", - "comment": null, + "comment": "", "available": true } }, @@ -1935,7 +1935,7 @@ "fields": { "label": "boniferie", "txt_idx": "boniferie", - "comment": null, + "comment": "", "available": true } }, @@ -1944,7 +1944,7 @@ "fields": { "label": "bord\u00e9", "txt_idx": "borde", - "comment": null, + "comment": "", "available": true } }, @@ -1953,7 +1953,7 @@ "fields": { "label": "bord\u00e9 \u00e0 clin", "txt_idx": "borde-a-clin", - "comment": null, + "comment": "", "available": true } }, @@ -1962,7 +1962,7 @@ "fields": { "label": "bord\u00e9 \u00e0 franc-bord", "txt_idx": "borde-a-franc-bord", - "comment": null, + "comment": "", "available": true } }, @@ -1971,7 +1971,7 @@ "fields": { "label": "borne", "txt_idx": "borne", - "comment": null, + "comment": "", "available": true } }, @@ -1980,7 +1980,7 @@ "fields": { "label": "butte", "txt_idx": "butte", - "comment": null, + "comment": "", "available": true } }, @@ -1989,7 +1989,7 @@ "fields": { "label": "calage", "txt_idx": "calage", - "comment": null, + "comment": "", "available": true } }, @@ -1998,7 +1998,7 @@ "fields": { "label": "calfatage", "txt_idx": "calfatage", - "comment": null, + "comment": "", "available": true } }, @@ -2007,7 +2007,7 @@ "fields": { "label": "calvaire", "txt_idx": "calvaire", - "comment": null, + "comment": "", "available": true } }, @@ -2016,7 +2016,7 @@ "fields": { "label": "canalisation", "txt_idx": "canalisation", - "comment": null, + "comment": "", "available": true } }, @@ -2025,7 +2025,7 @@ "fields": { "label": "cargaison", "txt_idx": "cargaison", - "comment": null, + "comment": "", "available": true } }, @@ -2034,7 +2034,7 @@ "fields": { "label": "cave", "txt_idx": "cave", - "comment": null, + "comment": "", "available": true } }, @@ -2043,7 +2043,7 @@ "fields": { "label": "cercueil", "txt_idx": "cercueil", - "comment": null, + "comment": "", "available": true } }, @@ -2052,7 +2052,7 @@ "fields": { "label": "charpente", "txt_idx": "charpente", - "comment": null, + "comment": "", "available": true } }, @@ -2061,7 +2061,7 @@ "fields": { "label": "clo\u00eetre", "txt_idx": "cloitre", - "comment": null, + "comment": "", "available": true } }, @@ -2070,7 +2070,7 @@ "fields": { "label": "cockpit", "txt_idx": "cockpit", - "comment": null, + "comment": "", "available": true } }, @@ -2079,7 +2079,7 @@ "fields": { "label": "colonnade", "txt_idx": "colonnade", - "comment": null, + "comment": "", "available": true } }, @@ -2088,7 +2088,7 @@ "fields": { "label": "colonne (\u00e9l\u00e9ment de)", "txt_idx": "colonne-element-de", - "comment": null, + "comment": "", "available": true } }, @@ -2097,7 +2097,7 @@ "fields": { "label": "construction", "txt_idx": "construction", - "comment": null, + "comment": "", "available": true } }, @@ -2106,7 +2106,7 @@ "fields": { "label": "coque", "txt_idx": "coque", - "comment": null, + "comment": "", "available": true } }, @@ -2115,7 +2115,7 @@ "fields": { "label": "coque bord\u00e9-premier", "txt_idx": "coque-borde-premier", - "comment": null, + "comment": "", "available": true } }, @@ -2124,7 +2124,7 @@ "fields": { "label": "coque membrure-premi\u00e8re", "txt_idx": "coque-membrure-premiere", - "comment": null, + "comment": "", "available": true } }, @@ -2133,7 +2133,7 @@ "fields": { "label": "couple", "txt_idx": "couple", - "comment": null, + "comment": "", "available": true } }, @@ -2142,7 +2142,7 @@ "fields": { "label": "cour", "txt_idx": "cour", - "comment": null, + "comment": "", "available": true } }, @@ -2151,7 +2151,7 @@ "fields": { "label": "courtine", "txt_idx": "courtine", - "comment": null, + "comment": "", "available": true } }, @@ -2160,7 +2160,7 @@ "fields": { "label": "croix", "txt_idx": "croix", - "comment": null, + "comment": "", "available": true } }, @@ -2169,7 +2169,7 @@ "fields": { "label": "crypte", "txt_idx": "crypte", - "comment": null, + "comment": "", "available": true } }, @@ -2178,7 +2178,7 @@ "fields": { "label": "cryptoportique", "txt_idx": "cryptoportique", - "comment": null, + "comment": "", "available": true } }, @@ -2187,7 +2187,7 @@ "fields": { "label": "cuve", "txt_idx": "cuve", - "comment": null, + "comment": "", "available": true } }, @@ -2196,7 +2196,7 @@ "fields": { "label": "cuvelage", "txt_idx": "cuvelage", - "comment": null, + "comment": "", "available": true } }, @@ -2205,7 +2205,7 @@ "fields": { "label": "dallage", "txt_idx": "dallage", - "comment": null, + "comment": "", "available": true } }, @@ -2214,7 +2214,7 @@ "fields": { "label": "demi-lune", "txt_idx": "demi-lune", - "comment": null, + "comment": "", "available": true } }, @@ -2223,7 +2223,7 @@ "fields": { "label": "d\u00e9potoir", "txt_idx": "depotoir", - "comment": null, + "comment": "", "available": true } }, @@ -2232,7 +2232,7 @@ "fields": { "label": "d\u00e9rive", "txt_idx": "derive", - "comment": null, + "comment": "", "available": true } }, @@ -2241,7 +2241,7 @@ "fields": { "label": "doublage", "txt_idx": "doublage", - "comment": null, + "comment": "", "available": true } }, @@ -2250,7 +2250,7 @@ "fields": { "label": "empierrement", "txt_idx": "empierrement", - "comment": null, + "comment": "", "available": true } }, @@ -2259,7 +2259,7 @@ "fields": { "label": "emplanture", "txt_idx": "emplanture", - "comment": null, + "comment": "", "available": true } }, @@ -2268,7 +2268,7 @@ "fields": { "label": "empreinte", "txt_idx": "empreinte", - "comment": null, + "comment": "", "available": true } }, @@ -2277,7 +2277,7 @@ "fields": { "label": "enclos", "txt_idx": "enclos", - "comment": null, + "comment": "", "available": true } }, @@ -2286,7 +2286,7 @@ "fields": { "label": "enclos (syst\u00e8me d')", "txt_idx": "enclos-systeme-d", - "comment": null, + "comment": "", "available": true } }, @@ -2295,7 +2295,7 @@ "fields": { "label": "entr\u00e9e am\u00e9nag\u00e9e", "txt_idx": "entree-amenagee", - "comment": null, + "comment": "", "available": true } }, @@ -2304,7 +2304,7 @@ "fields": { "label": "escalier", "txt_idx": "escalier", - "comment": null, + "comment": "", "available": true } }, @@ -2313,7 +2313,7 @@ "fields": { "label": "\u00e9tambot", "txt_idx": "etambot", - "comment": null, + "comment": "", "available": true } }, @@ -2322,7 +2322,7 @@ "fields": { "label": "\u00e9trave", "txt_idx": "etrave", - "comment": null, + "comment": "", "available": true } }, @@ -2331,7 +2331,7 @@ "fields": { "label": "\u00e9trave \u00e0 \u00e9peron", "txt_idx": "etrave-a-eperon", - "comment": null, + "comment": "", "available": true } }, @@ -2340,7 +2340,7 @@ "fields": { "label": "\u00e9tuve", "txt_idx": "etuve", - "comment": null, + "comment": "", "available": true } }, @@ -2349,7 +2349,7 @@ "fields": { "label": "ferrier", "txt_idx": "ferrier", - "comment": null, + "comment": "", "available": true } }, @@ -2358,7 +2358,7 @@ "fields": { "label": "fondation", "txt_idx": "fondation", - "comment": null, + "comment": "", "available": true } }, @@ -2367,7 +2367,7 @@ "fields": { "label": "fosse", "txt_idx": "fosse", - "comment": null, + "comment": "", "available": true } }, @@ -2376,7 +2376,7 @@ "fields": { "label": "foss\u00e9s (r\u00e9seau de)", "txt_idx": "fosses-reseau-de", - "comment": null, + "comment": "", "available": true } }, @@ -2385,7 +2385,7 @@ "fields": { "label": "four", "txt_idx": "four", - "comment": null, + "comment": "", "available": true } }, @@ -2394,7 +2394,7 @@ "fields": { "label": "foyer", "txt_idx": "foyer", - "comment": null, + "comment": "", "available": true } }, @@ -2403,7 +2403,7 @@ "fields": { "label": "foyer (vidange de)", "txt_idx": "foyer-vidange-de", - "comment": null, + "comment": "", "available": true } }, @@ -2412,7 +2412,7 @@ "fields": { "label": "front de taille", "txt_idx": "front-de-taille", - "comment": null, + "comment": "", "available": true } }, @@ -2421,7 +2421,7 @@ "fields": { "label": "fuselage", "txt_idx": "fuselage", - "comment": null, + "comment": "", "available": true } }, @@ -2430,7 +2430,7 @@ "fields": { "label": "galerie", "txt_idx": "galerie", - "comment": null, + "comment": "", "available": true } }, @@ -2439,7 +2439,7 @@ "fields": { "label": "garenne", "txt_idx": "garenne", - "comment": null, + "comment": "", "available": true } }, @@ -2448,7 +2448,7 @@ "fields": { "label": "glaci\u00e8re", "txt_idx": "glaciere", - "comment": null, + "comment": "", "available": true } }, @@ -2457,7 +2457,7 @@ "fields": { "label": "gouvernail", "txt_idx": "gouvernail", - "comment": null, + "comment": "", "available": true } }, @@ -2466,7 +2466,7 @@ "fields": { "label": "gradins", "txt_idx": "gradins", - "comment": null, + "comment": "", "available": true } }, @@ -2475,7 +2475,7 @@ "fields": { "label": "grange", "txt_idx": "grange", - "comment": null, + "comment": "", "available": true } }, @@ -2484,7 +2484,7 @@ "fields": { "label": "grenier", "txt_idx": "grenier", - "comment": null, + "comment": "", "available": true } }, @@ -2493,7 +2493,7 @@ "fields": { "label": "h\u00e9lice", "txt_idx": "helice", - "comment": null, + "comment": "", "available": true } }, @@ -2502,7 +2502,7 @@ "fields": { "label": "hypocauste", "txt_idx": "hypocauste", - "comment": null, + "comment": "", "available": true } }, @@ -2511,7 +2511,7 @@ "fields": { "label": "incin\u00e9ration", "txt_idx": "incineration", - "comment": null, + "comment": "", "available": true } }, @@ -2520,7 +2520,7 @@ "fields": { "label": "inhumation", "txt_idx": "inhumation", - "comment": null, + "comment": "", "available": true } }, @@ -2529,7 +2529,7 @@ "fields": { "label": "inscription", "txt_idx": "inscription", - "comment": null, + "comment": "", "available": true } }, @@ -2538,7 +2538,7 @@ "fields": { "label": "jardin", "txt_idx": "jardin", - "comment": null, + "comment": "", "available": true } }, @@ -2547,7 +2547,7 @@ "fields": { "label": "laraire", "txt_idx": "laraire", - "comment": null, + "comment": "", "available": true } }, @@ -2556,7 +2556,7 @@ "fields": { "label": "latrines", "txt_idx": "latrines", - "comment": null, + "comment": "", "available": true } }, @@ -2565,7 +2565,7 @@ "fields": { "label": "lest", "txt_idx": "lest", - "comment": null, + "comment": "", "available": true } }, @@ -2574,7 +2574,7 @@ "fields": { "label": "lev\u00e9e", "txt_idx": "levee", - "comment": null, + "comment": "", "available": true } }, @@ -2583,7 +2583,7 @@ "fields": { "label": "m\u00e2t", "txt_idx": "mat", - "comment": null, + "comment": "", "available": true } }, @@ -2592,7 +2592,7 @@ "fields": { "label": "membrure", "txt_idx": "membrure", - "comment": null, + "comment": "", "available": true } }, @@ -2601,7 +2601,7 @@ "fields": { "label": "meule fixe", "txt_idx": "meule-fixe", - "comment": null, + "comment": "", "available": true } }, @@ -2610,7 +2610,7 @@ "fields": { "label": "mosa\u00efque", "txt_idx": "mosaique", - "comment": null, + "comment": "", "available": true } }, @@ -2619,7 +2619,7 @@ "fields": { "label": "moteur", "txt_idx": "moteur", - "comment": null, + "comment": "", "available": true } }, @@ -2628,7 +2628,7 @@ "fields": { "label": "moule \u00e0 cloches", "txt_idx": "moule-a-cloches", - "comment": null, + "comment": "", "available": true } }, @@ -2637,7 +2637,7 @@ "fields": { "label": "mur", "txt_idx": "mur", - "comment": null, + "comment": "", "available": true } }, @@ -2646,7 +2646,7 @@ "fields": { "label": "niche", "txt_idx": "niche", - "comment": null, + "comment": "", "available": true } }, @@ -2655,7 +2655,7 @@ "fields": { "label": "niveau d'occupation", "txt_idx": "niveau-doccupation", - "comment": null, + "comment": "", "available": true } }, @@ -2664,7 +2664,7 @@ "fields": { "label": "oratoire", "txt_idx": "oratoire", - "comment": null, + "comment": "", "available": true } }, @@ -2673,7 +2673,7 @@ "fields": { "label": "orni\u00e8re", "txt_idx": "orniere", - "comment": null, + "comment": "", "available": true } }, @@ -2682,7 +2682,7 @@ "fields": { "label": "ouvrage avanc\u00e9", "txt_idx": "ouvrage-avance", - "comment": null, + "comment": "", "available": true } }, @@ -2691,7 +2691,7 @@ "fields": { "label": "palissade", "txt_idx": "palissade", - "comment": null, + "comment": "", "available": true } }, @@ -2700,7 +2700,7 @@ "fields": { "label": "paroi orn\u00e9e", "txt_idx": "paroi-ornee", - "comment": null, + "comment": "", "available": true } }, @@ -2709,7 +2709,7 @@ "fields": { "label": "pavage", "txt_idx": "pavage", - "comment": null, + "comment": "", "available": true } }, @@ -2718,7 +2718,7 @@ "fields": { "label": "pieu", "txt_idx": "pieu", - "comment": null, + "comment": "", "available": true } }, @@ -2727,7 +2727,7 @@ "fields": { "label": "pigeonnier", "txt_idx": "pigeonnier", - "comment": null, + "comment": "", "available": true } }, @@ -2736,7 +2736,7 @@ "fields": { "label": "pile", "txt_idx": "pile", - "comment": null, + "comment": "", "available": true } }, @@ -2745,7 +2745,7 @@ "fields": { "label": "plafond", "txt_idx": "plafond", - "comment": null, + "comment": "", "available": true } }, @@ -2754,7 +2754,7 @@ "fields": { "label": "plancher", "txt_idx": "plancher", - "comment": null, + "comment": "", "available": true } }, @@ -2763,7 +2763,7 @@ "fields": { "label": "polissoir fixe", "txt_idx": "polissoir-fixe", - "comment": null, + "comment": "", "available": true } }, @@ -2772,7 +2772,7 @@ "fields": { "label": "pont de bateau", "txt_idx": "pont-de-bateau", - "comment": null, + "comment": "", "available": true } }, @@ -2781,7 +2781,7 @@ "fields": { "label": "porte", "txt_idx": "porte", - "comment": null, + "comment": "", "available": true } }, @@ -2790,7 +2790,7 @@ "fields": { "label": "portique", "txt_idx": "portique", - "comment": null, + "comment": "", "available": true } }, @@ -2799,7 +2799,7 @@ "fields": { "label": "pr\u00e9ceinte", "txt_idx": "preceinte", - "comment": null, + "comment": "", "available": true } }, @@ -2808,7 +2808,7 @@ "fields": { "label": "pressoir", "txt_idx": "pressoir", - "comment": null, + "comment": "", "available": true } }, @@ -2817,7 +2817,7 @@ "fields": { "label": "puits", "txt_idx": "puits", - "comment": null, + "comment": "", "available": true } }, @@ -2826,7 +2826,7 @@ "fields": { "label": "purgerie", "txt_idx": "purgerie", - "comment": null, + "comment": "", "available": true } }, @@ -2835,7 +2835,7 @@ "fields": { "label": "quille", "txt_idx": "quille", - "comment": null, + "comment": "", "available": true } }, @@ -2844,7 +2844,7 @@ "fields": { "label": "r\u00e9cipient fixe", "txt_idx": "recipient-fixe", - "comment": null, + "comment": "", "available": true } }, @@ -2853,7 +2853,7 @@ "fields": { "label": "rempart", "txt_idx": "rempart", - "comment": null, + "comment": "", "available": true } }, @@ -2862,7 +2862,7 @@ "fields": { "label": "sarcophage", "txt_idx": "sarcophage", - "comment": null, + "comment": "", "available": true } }, @@ -2871,7 +2871,7 @@ "fields": { "label": "silo", "txt_idx": "silo", - "comment": null, + "comment": "", "available": true } }, @@ -2880,7 +2880,7 @@ "fields": { "label": "sol d'occupation", "txt_idx": "sol-doccupation", - "comment": null, + "comment": "", "available": true } }, @@ -2889,7 +2889,7 @@ "fields": { "label": "sol orn\u00e9", "txt_idx": "sol-orne", - "comment": null, + "comment": "", "available": true } }, @@ -2898,7 +2898,7 @@ "fields": { "label": "source am\u00e9nag\u00e9e", "txt_idx": "source-amenagee", - "comment": null, + "comment": "", "available": true } }, @@ -2907,7 +2907,7 @@ "fields": { "label": "souterrain", "txt_idx": "souterrain", - "comment": null, + "comment": "", "available": true } }, @@ -2916,7 +2916,7 @@ "fields": { "label": "statue", "txt_idx": "statue", - "comment": null, + "comment": "", "available": true } }, @@ -2925,7 +2925,7 @@ "fields": { "label": "statue-menhir", "txt_idx": "statue-menhir", - "comment": null, + "comment": "", "available": true } }, @@ -2934,7 +2934,7 @@ "fields": { "label": "st\u00e8le", "txt_idx": "stele", - "comment": null, + "comment": "", "available": true } }, @@ -2943,7 +2943,7 @@ "fields": { "label": "talus", "txt_idx": "talus", - "comment": null, + "comment": "", "available": true } }, @@ -2952,7 +2952,7 @@ "fields": { "label": "tour", "txt_idx": "tour", - "comment": null, + "comment": "", "available": true } }, @@ -2961,7 +2961,7 @@ "fields": { "label": "trace agraire", "txt_idx": "trace-agraire", - "comment": null, + "comment": "", "available": true } }, @@ -2970,7 +2970,7 @@ "fields": { "label": "train d'atterrissage", "txt_idx": "train-datterrissage", - "comment": null, + "comment": "", "available": true } }, @@ -2979,7 +2979,7 @@ "fields": { "label": "tranch\u00e9e d'extraction", "txt_idx": "tranchee-dextraction", - "comment": null, + "comment": "", "available": true } }, @@ -2988,7 +2988,7 @@ "fields": { "label": "trou de jauge", "txt_idx": "trou-de-jauge", - "comment": null, + "comment": "", "available": true } }, @@ -2997,7 +2997,7 @@ "fields": { "label": "trou de poteau", "txt_idx": "trou-de-poteau", - "comment": null, + "comment": "", "available": true } }, @@ -3006,7 +3006,7 @@ "fields": { "label": "trous de poteau (ensemble de)", "txt_idx": "trous-de-poteau-ensemble-de", - "comment": null, + "comment": "", "available": true } }, @@ -3015,7 +3015,7 @@ "fields": { "label": "tunnel", "txt_idx": "tunnel", - "comment": null, + "comment": "", "available": true } }, @@ -3024,7 +3024,7 @@ "fields": { "label": "urne", "txt_idx": "urne", - "comment": null, + "comment": "", "available": true } }, @@ -3033,7 +3033,7 @@ "fields": { "label": "vaigre", "txt_idx": "vaigre", - "comment": null, + "comment": "", "available": true } }, @@ -3042,7 +3042,7 @@ "fields": { "label": "verri\u00e8re", "txt_idx": "verriere", - "comment": null, + "comment": "", "available": true } }, @@ -3051,7 +3051,7 @@ "fields": { "label": "virure", "txt_idx": "virure", - "comment": null, + "comment": "", "available": true } }, @@ -3060,7 +3060,7 @@ "fields": { "label": "zone de rejet", "txt_idx": "zone-de-rejet", - "comment": null, + "comment": "", "available": true } }, @@ -3139,7 +3139,7 @@ "fields": { "label": "Non document\u00e9", "txt_idx": "not-documented", - "comment": null, + "comment": "", "available": true, "order": 10 } @@ -3149,7 +3149,7 @@ "fields": { "label": "Arbitraire", "txt_idx": "arbitrary", - "comment": null, + "comment": "", "available": true, "order": 20 } @@ -3159,7 +3159,7 @@ "fields": { "label": "Fiable", "txt_idx": "reliable", - "comment": null, + "comment": "", "available": true, "order": 30 } diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index f5bf540fa..61b815cb4 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -1762,7 +1762,7 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem, if self.operation_code is None: self.operation_code = self.get_available_operation_code(self.year) if hasattr(self, 'code_patriarche'): - self.code_patriarche = self.code_patriarche or None + self.code_patriarche = self.code_patriarche or "" item = super(Operation, self).save(*args, **kwargs) self.clean_parcel_duplicates() return item diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index d2cbb707e..bbf736112 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -1179,8 +1179,12 @@ def create_operation(user, orga=None, values=None): dct.update(values) if orga: dct['operator'] = orga - operation = models.Operation.objects.create(**dct) - return operation + if 'code_patriarche' not in dct: + idx = 1 + while models.Operation.objects.filter(code_patriarche=str(idx)).count(): + idx += 1 + dct["code_patriarche"] = str(idx) + return models.Operation.objects.create(**dct) class OperationInitTest(object): @@ -1328,24 +1332,28 @@ class OperationTest(TestCase, OperationInitTest): def test_complete_identifier(self): profile = get_current_profile() profile.operation_complete_identifier = \ - "{code_patriarche}-{town__numero_insee}" + "{code_patriarche}-{towns__numero_insee}" profile.save() + self.item = models.Operation.objects.get(pk=self.item.pk) + t = Town.objects.create(numero_insee="12345", name="OK town") + self.item.towns.add(t) + self.item = models.Operation.objects.get(pk=self.item.pk) self.item.code_patriarche = '123456789' self.item.year = 2020 self.item.save() self.item = models.Operation.objects.get(pk=self.item.pk) self.assertEqual(self.item.complete_identifier, '{}-{}'.format(self.item.code_patriarche, - self.item.town.numero_insee)) + t.numero_insee)) profile.operation_complete_identifier = \ - "{year}-{town__numero_insee}" + "{year}-{towns__numero_insee}" profile.save() self.item.save() self.item = models.Operation.objects.get(pk=self.item.pk) self.assertEqual(self.item.complete_identifier, '{}-{}'.format(self.item.year, - self.item.town.numero_insee)) + t.numero_insee)) def test_associated(self): scientist = Person.objects.create(name="C-3PO") |