Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[server] Fix access control test
  • Loading branch information
elpaso committed Apr 22, 2017
1 parent c2ba231 commit 97e55d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/src/python/test_qgsserver_accesscontrol.py
Expand Up @@ -23,7 +23,7 @@
from utilities import unitTestDataPath
from osgeo import gdal
from osgeo.gdalconst import GA_ReadOnly
from qgis.server import QgsServer, QgsAccessControlFilter
from qgis.server import QgsServer, QgsAccessControlFilter, QgsServerRequest
from qgis.core import QgsRenderChecker, QgsApplication
from qgis.PyQt.QtCore import QSize
import tempfile
Expand Down Expand Up @@ -1374,7 +1374,7 @@ def test_wfs_getfeature_project_subsetstring3(self):

def _handle_request(self, restricted, query_string, **kwargs):
self._accesscontrol._active = restricted
qs = "?" + query_string if query_string is not None else None
qs = "?" + query_string if query_string is not None else ''
result = self._result(self._server.handleRequest(qs, **kwargs))
return result

Expand All @@ -1398,13 +1398,13 @@ def _get_restricted(self, query_string):

def _post_fullaccess(self, data, query_string=None):
self._server.putenv("QGIS_PROJECT_FILE", self.projectPath)
result = self._handle_request(False, query_string, requestMethod='POST', data=data)
result = self._handle_request(False, query_string, requestMethod=QgsServerRequest.PostMethod, data=data)
self._server.putenv("QGIS_PROJECT_FILE", '')
return result

def _post_restricted(self, data, query_string=None):
self._server.putenv("QGIS_PROJECT_FILE", self.projectPath)
result = self._handle_request(True, query_string, requestMethod='POST', data=data)
result = self._handle_request(True, query_string, requestMethod=QgsServerRequest.PostMethod, data=data)
self._server.putenv("QGIS_PROJECT_FILE", '')
return result

Expand Down

0 comments on commit 97e55d2

Please sign in to comment.