summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2022-08-29 16:12:00 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-12 12:23:18 +0100
commit3d48c54fef303bd869b51dc967c4463a5449cd67 (patch)
tree419d70328d660e596066bc0425609cf93cf61729
parent7a787f0ef5f0cbe381e87267278ea7fd577596d3 (diff)
downloadIshtar-3d48c54fef303bd869b51dc967c4463a5449cd67.tar.bz2
Ishtar-3d48c54fef303bd869b51dc967c4463a5449cd67.zip
New geo fixtures
-rw-r--r--Makefile.example31
-rw-r--r--ishtar_common/fixtures/initial_geo-fr.json187
-rw-r--r--ishtar_common/models_common.py4
-rw-r--r--ishtar_common/tests.py2
4 files changed, 210 insertions, 14 deletions
diff --git a/Makefile.example b/Makefile.example
index 57642a48f..9fd739e9a 100644
--- a/Makefile.example
+++ b/Makefile.example
@@ -87,15 +87,15 @@ test: clean ## launch tests
cd $(project); $(PYTHON) manage.py test $(apps)
soft_test: clean ## launch tests without database regeneration
- cd $(project); $(PYTHON) manage.py test -k --tag gis --exclude-tag ui $(apps)
+ cd $(project); $(PYTHON) manage.py test -k --tag gis --exclude-tag ui --exclude-tag libreoffice $(apps)
cd $(project); $(PYTHON) manage.py test -k --exclude-tag gis --exclude-tag ui $(apps)
soft_test_verbose: clean ## launch tests without database regeneration - verbose
cd $(project); $(PYTHON) manage.py test -k --verbosity 2 $(apps)
soft_test_multi: clean ## launch multi-process tests without database regeneration
- cd $(project); $(PYTHON) manage.py test -k --parallel $(NB_PROCESS) --exclude-tag ui --tag gis $(apps)
- cd $(project); $(PYTHON) manage.py test -k --parallel $(NB_PROCESS) --exclude-tag ui --exclude-tag gis $(apps)
+ cd $(project); $(PYTHON) manage.py test -k --parallel $(NB_PROCESS) --exclude-tag libreoffice --exclude-tag ui --tag gis $(apps)
+ cd $(project); $(PYTHON) manage.py test -k --parallel $(NB_PROCESS) --exclude-tag libreoffice --exclude-tag ui --exclude-tag gis $(apps)
test_ui: clean ## launch tests for UI
cd $(project); $(PYTHON) manage.py test --tag ui $(apps)
@@ -107,12 +107,15 @@ build_gitlab: clean collectstatic ## specific build for gitlab
cd $(project); $(PYTHON) ./manage.py migrate
test_gitlab: build_gitlab ##
- cd $(project); $(PYTHON) manage.py test --tag gis --exclude-tag ui $(apps)
- cd $(project); $(PYTHON) manage.py test --exclude-tag gis --exclude-tag ui $(apps)
+ cd $(project); $(PYTHON) manage.py test --tag gis --exclude-tag ui --exclude-tag libreoffice $(apps)
+ cd $(project); $(PYTHON) manage.py test --exclude-tag gis --exclude-tag ui --exclude-tag libreoffice $(apps)
soft_test_gitlab: build_gitlab
cd $(project); $(PYTHON) manage.py -k test $(apps)
+run_libreoffice:
+ /usr/bin/libreoffice --headless --accept="socket,host=127.0.0.1,port=8101;urp;" --nodefault --nofirststartwizard --nolockcheck --nologo --norestore --invisible --pidfile=/var/run/libreoffice.pid
+
##@ Development: checks
coverage: clean ## launch test coverage
@@ -137,7 +140,11 @@ run: ## run test server
cd $(project); $(PYTHON) manage.py runserver 0.0.0.0:8000
runcelery: ## run a celery worker
- celery -A example_project worker -l info
+ celery -A example_project worker -l INFO
+
+blackd: ## blackd service
+ $(VENV)bin/blackd
+
##@ Manage fixtures
@@ -148,7 +155,7 @@ fixtures_auth:
auth.permission auth.group \
> '../fixtures/initial_data-auth-'$(default_data)'.json'
-fixtures_common: fixtures_common_importers fixtures_spatialrefsystem
+fixtures_common: fixtures_common_importers fixtures_geo
cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 --natural-primary --natural-foreign \
ishtar_common.authortype \
ishtar_common.profiletype \
@@ -190,10 +197,14 @@ fixtures_common_towns:
sed -e 's/"children": *\[\r *\[\r *"[0-9-]*", *\r *[0-9]*\ *\r *\]\r *\]/"children": []/g' | \
tr '\r' '\n' > 'ishtar_common/fixtures/towns_norel-'$(default_data)'.json'
-fixtures_spatialrefsystem:
+fixtures_geo:
cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 --natural-primary --natural-foreign \
- ishtar_common.SpatialReferenceSystem \
- > '../ishtar_common/fixtures/initial_spatialrefsystem-'$(default_data)'.json'
+ ishtar_common.spatialreferencesystem \
+ ishtar_common.geobuffertype \
+ ishtar_common.geoorigintype \
+ ishtar_common.geodatatype \
+ ishtar_common.geoprovidertype \
+ > '../ishtar_common/fixtures/initial_geo-'$(default_data)'.json'
fixtures_operations:
cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 --natural-primary --natural-foreign \
diff --git a/ishtar_common/fixtures/initial_geo-fr.json b/ishtar_common/fixtures/initial_geo-fr.json
index ea244e0d0..514d9a9bf 100644
--- a/ishtar_common/fixtures/initial_geo-fr.json
+++ b/ishtar_common/fixtures/initial_geo-fr.json
@@ -28,7 +28,7 @@
"fields": {
"label": "RGF93 / Lambert-93",
"txt_idx": "lambert93",
- "comment": "",
+ "comment": "Projection: Lambert_Conformal_Conic False_Easting: 700000.0 False_Northing: 6600000.0 Central_Meridian: 3.0 Standard_Parallel_1: 44.0 Standard_Parallel_2: 49.0 Latitude_Of_Origin: 46.5 Linear Unit: Meter (1.0) Geographic Coordinate System: GCS_RGF_1993 Angular Unit: Degree (0.0174532925199433) Prime Meridian: Greenwich (0.0) Datum: D_RGF_1993 Spheroid: GRS_1980 Semimajor Axis: 6378137.0 Semiminor Axis: 6356752.314140356 Inverse Flattening: 298.257222101",
"available": true,
"order": 10,
"auth_name": "EPSG",
@@ -490,5 +490,190 @@
"auth_name": "EPSG",
"srid": 4559
}
+},
+{
+ "model": "ishtar_common.geobuffertype",
+ "fields": {
+ "label": "Incertitude",
+ "txt_idx": "incertitude",
+ "comment": "",
+ "available": true,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geobuffertype",
+ "fields": {
+ "label": "Rayon de collecte",
+ "txt_idx": "rayon-de-collecte",
+ "comment": "",
+ "available": true,
+ "order": 20
+ }
+},
+{
+ "model": "ishtar_common.geoorigintype",
+ "fields": {
+ "label": "Relev\u00e9 topographique",
+ "txt_idx": "releve-topographique",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geoorigintype",
+ "fields": {
+ "label": "Digitalisation de carte ancienne",
+ "txt_idx": "digitalisation-de-carte-ancienne",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geoorigintype",
+ "fields": {
+ "label": "Relev\u00e9 GPS",
+ "txt_idx": "releve-gps",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geodatatype",
+ "fields": {
+ "label": "Limites commune",
+ "txt_idx": "town-limit",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geodatatype",
+ "fields": {
+ "label": "Emprise de l'op\u00e9ration",
+ "txt_idx": "operation-area",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geodatatype",
+ "fields": {
+ "label": "Centre de l'op\u00e9ration",
+ "txt_idx": "operation-center",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geodatatype",
+ "fields": {
+ "label": "Limites de zone communale",
+ "txt_idx": "area-limit",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geodatatype",
+ "fields": {
+ "label": "Emprise du site",
+ "txt_idx": "archaeologicalsite-area",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geodatatype",
+ "fields": {
+ "label": "Centre du site",
+ "txt_idx": "archaeologicalsite-center",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geodatatype",
+ "fields": {
+ "label": "Contour d'unit\u00e9 d'enregistrement",
+ "txt_idx": "contextrecord-outline",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geodatatype",
+ "fields": {
+ "label": "Centre de l'unit\u00e9 d'enregistrement",
+ "txt_idx": "contextrecord-center",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geodatatype",
+ "fields": {
+ "label": "Contour du mobilier d'origine",
+ "txt_idx": "basefind-outline",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geodatatype",
+ "fields": {
+ "label": "Centre du mobilier d'origine",
+ "txt_idx": "basefind-center",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geodatatype",
+ "fields": {
+ "label": "Point mobilier",
+ "txt_idx": "point-mobilier",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
+},
+{
+ "model": "ishtar_common.geoprovidertype",
+ "fields": {
+ "label": "IGN",
+ "txt_idx": "france-ign",
+ "comment": "",
+ "available": true,
+ "parent": null,
+ "order": 10
+ }
}
]
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index aa644f35a..221fa3ede 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -2008,8 +2008,8 @@ class SpatialReferenceSystem(GeneralType):
srid = models.IntegerField(_("Authority SRID"))
class Meta:
- verbose_name = _("Spatial reference system")
- verbose_name_plural = _("Spatial reference systems")
+ verbose_name = _("Geographic - Spatial reference system")
+ verbose_name_plural = _("Geographic - Spatial reference systems")
ordering = (
"order",
"label",
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 1ddc94cb2..dfae6c164 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -100,7 +100,7 @@ if settings.SELENIUM_TEST:
COMMON_FIXTURES = [
settings.ROOT_PATH + "../fixtures/initial_data-auth-fr.json",
settings.ROOT_PATH + "../ishtar_common/fixtures/initial_data-fr.json",
- settings.ROOT_PATH + "../ishtar_common/fixtures/initial_spatialrefsystem-fr.json",
+ settings.ROOT_PATH + "../ishtar_common/fixtures/initial_geo-fr.json",
settings.ROOT_PATH + "../ishtar_common/fixtures/initial_importtypes-fr.json",
]