Skip to content
Permalink
Browse files

[Server] Add GetContext accesscontrol test

  • Loading branch information
rldhont committed May 26, 2017
1 parent 83b3368 commit ce3cbeb963027ccfa64d65202eea6464d6dc7842
Showing with 28 additions and 0 deletions.
  1. +28 −0 tests/src/python/test_qgsserver_accesscontrol.py
@@ -264,6 +264,34 @@ def test_wms_getprojectsettings(self):
str(response).find("<LayerDrawingOrder>Country_Labels,dem,Hello_Filter_SubsetString,Hello_Project_SubsetString,Hello_SubsetString,Hello,db_point</LayerDrawingOrder>") != -1,
"LayerDrawingOrder in GetProjectSettings\n%s" % response)

def test_wms_getprojectsettings(self):
query_string = "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),
"SERVICE": "WMS",
"VERSION": "1.1.1",
"REQUEST": "GetContext"
}.items())])

response, headers = self._get_fullaccess(query_string)
self.assertTrue(
str(response).find("name=\"Hello\"") != -1,
"No Hello layer in GetContext\n%s" % response)
self.assertTrue(
str(response).find("name=\"Country\"") != -1,
"No Country layer in GetProjectSettings\n%s" % response)
self.assertTrue(
str(response).find("name=\"Country\"")
< str(response).find("name=\"Hello\""),
"Hello layer not after Country layer\n%s" % response)

response, headers = self._get_restricted(query_string)
self.assertTrue(
str(response).find("name=\"Hello\"") != -1,
"No Hello layer in GetContext\n%s" % response)
self.assertFalse(
str(response).find("name=\"Country\"") != -1,
"No Country layer in GetProjectSettings\n%s" % response)

def test_wms_describelayer_hello(self):
query_string = "&".join(["%s=%s" % i for i in list({
"MAP": urllib.parse.quote(self.projectPath),

0 comments on commit ce3cbeb

Please sign in to comment.