summaryrefslogtreecommitdiff
path: root/archaeological_context_records
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-04-11 18:56:05 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-04-11 18:56:05 +0200
commitdfd6fd2551a9cc54e6b69d4f5d4d4aa328b9cc7a (patch)
tree916cf36d9cd6d58e0c10e8711ee0c3f96c7bb221 /archaeological_context_records
parent987f84ca3aec153a6a9179e2b51083d7afaa9337 (diff)
parente3bdd4b6d2a32c010138e8f4581234d18cf51519 (diff)
downloadIshtar-dfd6fd2551a9cc54e6b69d4f5d4d4aa328b9cc7a.tar.bz2
Ishtar-dfd6fd2551a9cc54e6b69d4f5d4d4aa328b9cc7a.zip
Merge branch 'master' into v0.9
Diffstat (limited to 'archaeological_context_records')
-rw-r--r--archaeological_context_records/fixtures/initial_data-fr.json322
-rw-r--r--archaeological_context_records/tests.py16
2 files changed, 237 insertions, 101 deletions
diff --git a/archaeological_context_records/fixtures/initial_data-fr.json b/archaeological_context_records/fixtures/initial_data-fr.json
index 22b96aa41..f43b46a2a 100644
--- a/archaeological_context_records/fixtures/initial_data-fr.json
+++ b/archaeological_context_records/fixtures/initial_data-fr.json
@@ -13,7 +13,7 @@
"pk": 2,
"model": "archaeological_context_records.datingquality",
"fields": {
- "comment": "datation a v\u00e9rifier",
+ "comment": "Datation \u00e0 v\u00e9rifier",
"available": true,
"txt_idx": "estimated",
"label": "Estim\u00e9e "
@@ -218,15 +218,15 @@
}
},
{
- "pk": 7,
+ "pk": 15,
"model": "archaeological_context_records.unit",
"fields": {
"comment": "",
"available": true,
"parent": null,
- "label": "Alt\u00e9ration",
+ "label": "Anomalie",
"order": 100,
- "txt_idx": "alteration"
+ "txt_idx": "anomaly"
}
},
{
@@ -242,51 +242,15 @@
}
},
{
- "pk": 4,
+ "pk": 16,
"model": "archaeological_context_records.unit",
"fields": {
"comment": "",
"available": true,
"parent": null,
- "label": "Couche",
- "order": 100,
- "txt_idx": "layer"
- }
- },
- {
- "pk": 5,
- "model": "archaeological_context_records.unit",
- "fields": {
- "comment": "",
- "available": true,
- "parent": 4,
- "label": "Couche construite",
- "order": 100,
- "txt_idx": "builded_layer"
- }
- },
- {
- "pk": 2,
- "model": "archaeological_context_records.unit",
- "fields": {
- "comment": "",
- "available": true,
- "parent": 1,
- "label": "Creusement",
- "order": 100,
- "txt_idx": "digging"
- }
- },
- {
- "pk": 3,
- "model": "archaeological_context_records.unit",
- "fields": {
- "comment": "",
- "available": true,
- "parent": 1,
- "label": "D\u00e9rasement",
+ "label": "Fait",
"order": 100,
- "txt_idx": "partial_destruction"
+ "txt_idx": "fact"
}
},
{
@@ -302,15 +266,15 @@
}
},
{
- "pk": 8,
+ "pk": 18,
"model": "archaeological_context_records.unit",
"fields": {
"comment": "",
"available": true,
- "parent": 7,
- "label": "Impact thermique",
+ "parent": null,
+ "label": "Log",
"order": 100,
- "txt_idx": "thermal_impact"
+ "txt_idx": "log"
}
},
{
@@ -319,25 +283,13 @@
"fields": {
"comment": "Cette unit\u00e9 n'a pas de volume.",
"available": true,
- "parent": null,
+ "parent": 17,
"label": "N\u00e9gative",
"order": 100,
"txt_idx": "negative"
}
},
{
- "pk": 6,
- "model": "archaeological_context_records.unit",
- "fields": {
- "comment": "",
- "available": true,
- "parent": 4,
- "label": "Remblai",
- "order": 100,
- "txt_idx": "embankment"
- }
- },
- {
"pk": 13,
"model": "archaeological_context_records.unit",
"fields": {
@@ -374,6 +326,18 @@
}
},
{
+ "pk": 17,
+ "model": "archaeological_context_records.unit",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "label": "US",
+ "order": 100,
+ "txt_idx": "stratigraphic-unit"
+ }
+ },
+ {
"pk": 14,
"model": "archaeological_context_records.unit",
"fields": {
@@ -420,6 +384,20 @@
}
},
{
+ "pk": 10,
+ "model": "archaeological_context_records.relationtype",
+ "fields": {
+ "comment": "UE remplie par une autre",
+ "available": true,
+ "tiny_label": "",
+ "label": "Combl\u00e9e par",
+ "symmetrical": false,
+ "inverse_relation": 2,
+ "order": 1,
+ "txt_idx": "filled_by"
+ }
+ },
+ {
"pk": 1,
"model": "archaeological_context_records.relationtype",
"fields": {
@@ -439,8 +417,8 @@
"fields": {
"comment": "UE recoup\u00e9e par une autre",
"available": true,
- "tiny_label": null,
- "label": "Coup\u00e9 par",
+ "tiny_label": "",
+ "label": "Coup\u00e9e par",
"symmetrical": false,
"inverse_relation": 1,
"order": 1,
@@ -462,31 +440,45 @@
}
},
{
- "pk": 3,
+ "pk": 6,
"model": "archaeological_context_records.relationtype",
"fields": {
- "comment": "UE situ\u00e9e au-dessus d'une autre",
+ "comment": "UE faisant partie d'une autre",
"available": true,
"tiny_label": "",
- "label": "Est au-dessus de",
+ "label": "Incluse dans",
"symmetrical": false,
- "inverse_relation": 7,
+ "inverse_relation": 5,
"order": 1,
- "txt_idx": "is_above"
+ "txt_idx": "is_included"
}
},
{
- "pk": 10,
+ "pk": 5,
"model": "archaeological_context_records.relationtype",
"fields": {
- "comment": "UE remplie par une autre",
+ "comment": "UE en incluant (regroupant) d'autres (ex: tranch\u00e9e / structures ou entre structure / US, etc.)",
"available": true,
"tiny_label": "",
- "label": "Est combl\u00e9 par",
+ "label": "Inclut",
"symmetrical": false,
- "inverse_relation": 2,
+ "inverse_relation": 6,
"order": 1,
- "txt_idx": "filled_by"
+ "txt_idx": "include"
+ }
+ },
+ {
+ "pk": 4,
+ "model": "archaeological_context_records.relationtype",
+ "fields": {
+ "comment": "\u00c0 pr\u00e9ciser ",
+ "available": true,
+ "tiny_label": "",
+ "label": "Relation indirecte",
+ "symmetrical": true,
+ "inverse_relation": null,
+ "order": 1,
+ "txt_idx": "indirect_relation"
}
},
{
@@ -496,7 +488,7 @@
"comment": "UE situ\u00e9e en-dessous d'une autre",
"available": true,
"tiny_label": "",
- "label": "Est en-dessous de",
+ "label": "Sous",
"symmetrical": false,
"inverse_relation": 3,
"order": 1,
@@ -504,45 +496,187 @@
}
},
{
- "pk": 6,
+ "pk": 3,
"model": "archaeological_context_records.relationtype",
"fields": {
- "comment": "UE faisant partie d'une autre",
+ "comment": "UE situ\u00e9e au-dessus d'une autre",
"available": true,
"tiny_label": "",
- "label": "Est inclus dans",
+ "label": "Sur",
"symmetrical": false,
- "inverse_relation": 5,
+ "inverse_relation": 7,
"order": 1,
- "txt_idx": "is_included"
+ "txt_idx": "is_above"
+ }
+ },
+ {
+ "pk": 1,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "manual-overflowing-cut",
+ "label": "Coupe manuelle d\u00e9bordante"
+ }
+ },
+ {
+ "pk": 2,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "mechanical-overflowing-cut",
+ "label": "Coupe m\u00e9canique d\u00e9bordante"
+ }
+ },
+ {
+ "pk": 3,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "mechanical-stripping",
+ "label": "D\u00e9capage m\u00e9canique"
+ }
+ },
+ {
+ "pk": 6,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "100-percent-excavated",
+ "label": "Fouill\u00e9e \u00e0 100%"
+ }
+ },
+ {
+ "pk": 4,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "25-percent-excavated",
+ "label": "Fouill\u00e9e \u00e0 25%"
}
},
{
"pk": 5,
- "model": "archaeological_context_records.relationtype",
+ "model": "archaeological_context_records.excavationtechnictype",
"fields": {
- "comment": "UE en incluant (regroupant) d'autres (ex: tranch\u00e9e / structures ou entre structure / US, etc.)",
+ "comment": "",
"available": true,
- "tiny_label": "",
- "label": "Inclut",
- "symmetrical": false,
- "inverse_relation": 6,
- "order": 1,
- "txt_idx": "include"
+ "txt_idx": "50-percent-excavated",
+ "label": "Fouill\u00e9e \u00e0 50%"
+ }
+ },
+ {
+ "pk": 7,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "manual-dig",
+ "label": "Fouille manuelle"
+ }
+ },
+ {
+ "pk": 10,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "manual-dig-by-planimetry",
+ "label": "Fouille manuelle en planim\u00e9trie"
+ }
+ },
+ {
+ "pk": 9,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "manual-dig-by-half",
+ "label": "Fouille manuelle par moiti\u00e9"
+ }
+ },
+ {
+ "pk": 8,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "manual-dig-by-quarter",
+ "label": "Fouille manuelle par quart"
+ }
+ },
+ {
+ "pk": 11,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "mechanical-dig",
+ "label": "Fouille m\u00e9canique"
+ }
+ },
+ {
+ "pk": 12,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "not-digged",
+ "label": "Non fouill\u00e9e"
+ }
+ },
+ {
+ "pk": 13,
+ "model": "archaeological_context_records.excavationtechnictype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "tested",
+ "label": "Test\u00e9e"
+ }
+ },
+ {
+ "pk": 2,
+ "model": "archaeological_context_records.documentationtype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "section",
+ "label": "Coupe"
+ }
+ },
+ {
+ "pk": 3,
+ "model": "archaeological_context_records.documentationtype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "photo",
+ "label": "Photo"
}
},
{
"pk": 4,
- "model": "archaeological_context_records.relationtype",
+ "model": "archaeological_context_records.documentationtype",
"fields": {
- "comment": "\u00c0 pr\u00e9ciser ",
+ "comment": "",
"available": true,
- "tiny_label": "",
- "label": "Relation indirecte",
- "symmetrical": true,
- "inverse_relation": null,
- "order": 1,
- "txt_idx": "indirect_relation"
+ "txt_idx": "map",
+ "label": "Plan"
+ }
+ },
+ {
+ "pk": 1,
+ "model": "archaeological_context_records.documentationtype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "has-furniture",
+ "label": "Pr\u00e9sence de mobilier"
}
}
] \ No newline at end of file
diff --git a/archaeological_context_records/tests.py b/archaeological_context_records/tests.py
index 4226b42ea..e697459b5 100644
--- a/archaeological_context_records/tests.py
+++ b/archaeological_context_records/tests.py
@@ -60,7 +60,7 @@ class ImportContextRecordTest(ImportTest, TestCase):
unit__txt_idx='not_in_context').count(), 3)
self.assertEqual(
models.ContextRecord.objects.filter(
- unit__txt_idx='layer').count(), 1)
+ unit__txt_idx='negative').count(), 1)
def test_model_limitation(self):
old_nb = models.ContextRecord.objects.count()
@@ -405,12 +405,14 @@ class ContextRecordSearchTest(ContextRecordInit, TestCase):
cr = self.context_records[0]
c = Client()
+ su = models.Unit.objects.get(txt_idx='stratigraphic-unit')
neg = models.Unit.objects.get(txt_idx='negative')
- dig = models.Unit.objects.get(txt_idx='digging')
- dest = models.Unit.objects.get(txt_idx='partial_destruction')
- cr.unit = (dig)
+ dest = models.Unit.objects.get(txt_idx='sector')
+ dest.parent = su
+ dest.save()
+ cr.unit = (neg)
cr.save()
- search = {'unit': dig.pk}
+ search = {'unit': neg.pk}
# no result when no authentication
response = c.get(reverse('get-contextrecord'), search)
@@ -424,7 +426,7 @@ class ContextRecordSearchTest(ContextRecordInit, TestCase):
res = json.loads(response.content)
self.assertTrue(res['total'] == 1)
self.assertEqual(res["rows"][0]["unit"],
- unicode(dig))
+ unicode(neg))
# no result for the brother
search = {'unit': dest.pk}
@@ -433,7 +435,7 @@ class ContextRecordSearchTest(ContextRecordInit, TestCase):
self.assertEqual(json.loads(response.content)['total'], 0)
# one result for the father
- search = {'unit': neg.pk}
+ search = {'unit': su.pk}
response = c.get(reverse('get-contextrecord'), search)
self.assertEqual(response.status_code, 200)
self.assertEqual(json.loads(response.content)['total'], 1)