Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unittest for map-json function with qgis-server backend #373

Open
wants to merge 96 commits into
base: 2.8.x-qgis_server
Choose a base branch
from

Conversation

boney-bun
Copy link

fix #207

the unittest is basically same with geonode/qgis_server/tests/test_views.py from #330 .
a slight modification is checking the thumbnails.
adding this unittest for covering the qgis-server side.
there exist test_map_json for geoserver backend.

@lucernae i need you opinion about this PR. we can simply ignore this PR if it is unnecessary.

lucernae and others added 30 commits May 29, 2017 11:52
Add qgis_server backend support for geonode:

* Add QGIS Server app.

* Push layers to local storage for qgis backend.

* Handling for updating old layer object.

* Implementation for deleting a layer.

* Put delete layer in pre_delete QGISServerLayer

* Add link to download zip file.

* Better link in layer detail page.

* create a QGIS project when a layer is uploaded

* update qgis project

* add gis tools

* serve tiles with a WMS wrapper

* forward legend request to QGIS WMS if the legend is not in cache

* Add tile url to link. Able to show the layer now.

* Add link for legend.

* check if the PNG is valid, remove it if it is not valid

* get a thumbnail from qgis server

* Move import signals to end of model to avoid circular import.

* Add thumbnail for layers.

* add indicator for analysis task process

* Hide filename for generated qml legend

* First working wms map in the map page creation.

* better code structure and add local_setting sample.

* enable WFS in the qgis template

* Replace SRID 900913 to 3857.

* Add DescribeLayer in qgisserver app.

* Add DescribeFeatureType in qgisserver app.

* Add Describe FeatureType

* Renaming wms to better method name.

* Styling legend.

* Make print map dialog works.

* Temporary hack for map printing.

* fix transparency when calling the WMS

* fix qgis project with a raster

* fix the projection in the QGIS template if different than 4326

* remove cache when we remove the qgis layer

* set the attributes for a vector layer using WFS

* remove qgis project template

* fix attribute table when calling the WFS with the new server plugin

* Set local layer.

* Call the server plugin while saving the layer in the DB to create the qgis project

* update mimetype to content_type due to django 1.7

* create qgis map

* Refactor django.conf.settings access

* Refactor thumbnail creation to use celery

* Use relative url for layer thumbnail.

* Update migrations for geonode:2.6.x

* fix kartoza#19: thumbnail and legend url resolver

* issue kartoza#21: Provide GeoTIFF download url

* delete and copy layers properly:

* fix kartoza#24: File saved as different name sometimes

* fix kartoza#25: Cache files not deleted when layer deleted
- Add thumbnail for map
- Fix thumbnail tests for layer and map
* include layer links in layers API
* include map layer list in maps API
* include geonode version in output for resource based API
This is to refrain from bothering them with unnecessary emails
- Refactor thumbnail url generator for QGIS Server. Now giving direct url to
  QGIS Server, instead of proxying to Django.

- Remove unnecessary thumbnail view in qgis_server, because geonode already
  have internal cache for thumbnail. Thumbnail should just be accessed
  directly to QGIS Server without proxy.

- Fix map creation test.

- Refactor wrong/inconsistent bbox convention for maps.
Enable ASCII file upload and create link for ASCII file.
* Add download zipped files for non-shapefile.

* Use image/tiff for qgis server GeoTIFF mime links.

* Add unit test for zipped all files link for raster.
boney-bun and others added 12 commits October 13, 2017 06:26
* fix default map action for downloading and edit
* fix the flow in maps/views.py
* tidy up unittest for both backends

partially fix kartoza#207
* fix set thumbnail and remove map
* add logger

partially fix kartoza#207
* add QLR and QGS unittest for layer and map
* add mapid param in geoserver's function view for download QLR
* revise mime type for QLR and QGS
* embed full static HTML page as leaflet page
* removes unnecessary comments
* add test case for download leaflet page
* fix reverse for geoserver
* fix travis error on geoserver

fix kartoza#151
* bug fix embed widget, the previous code still encountered problem with CORS
* fix travis error
* embed widget link for qgis-server and geoserver backend
* embed widget link and add copy button
* refactor map projection on the frontend into django views

fix kartoza#152
@codecov
Copy link

codecov bot commented Oct 30, 2017

Codecov Report

Merging #373 into master-qgis_server will decrease coverage by 0.22%.
The diff coverage is 100%.

Impacted file tree graph

@@                  Coverage Diff                   @@
##           master-qgis_server     #373      +/-   ##
======================================================
- Coverage               41.07%   40.84%   -0.23%     
======================================================
  Files                     329      329              
  Lines                   25751    25773      +22     
  Branches                 3389     3389              
======================================================
- Hits                    10576    10527      -49     
- Misses                  14543    14619      +76     
+ Partials                  632      627       -5
Impacted Files Coverage Δ
geonode/maps/tests.py 98.17% <100%> (+0.09%) ⬆️
geonode/services/tests.py 75% <0%> (-17.5%) ⬇️
geonode/services/views.py 25.17% <0%> (-7.87%) ⬇️
geonode/utils.py 54.15% <0%> (-1.27%) ⬇️
geonode/layers/models.py 76.51% <0%> (-0.72%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ddc0aba...39af14a. Read the comment docs.

@@ -168,6 +168,51 @@ def test_map_json(self):
self.assertEquals(map_obj.abstract, "Abstract2")
self.assertEquals(map_obj.layer_set.all().count(), 1)

@on_ogc_backend(qgis_server.BACKEND_PACKAGE)
def test_map_json_on_qgis_server(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you merge this unittests with the above one? It seems to be doing generic things. It should be working with geoserver/qgis_server. Then we can remove @on_ogc_backend decorator.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if this truly specific to QGIS Server, then we need to move it to geonode.qgis_server.tests module

"url": "http://{s}.tile.osm.org/{z}/{x}/{y}.png"
},
"source_san_andres_y_providencia_administrative": {
"url": "http://geonode.dev/qgis-server/tiles"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you take this kind of URL dynamically from the layer object instead of hardcoded it.

Copy link
Collaborator

@lucernae lucernae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some comments here.

@gubuntu
Copy link

gubuntu commented Oct 10, 2018

@boney-bun merge or close this PR please

@boney-bun boney-bun changed the base branch from master-qgis_server to 2.8.x-qgis_server October 31, 2018 05:00
@gubuntu
Copy link

gubuntu commented Jan 7, 2019

ping @boney-bun !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants