Skip to content
Browse files
Add tests for server locale override options
  • Loading branch information
elpaso committed Apr 1, 2019
1 parent 120ae77 commit 8a32848f85757b4e2b391dc8d2c035e5e32fc326
Show file tree
Hide file tree
Showing 5 changed files with 724 additions and 0 deletions.
@@ -0,0 +1,81 @@
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer Locale Override Options.
From build dir, run: ctest -R PyQgsServerLocaleOverride -V
.. note:: This test needs env vars to be set before the server is
configured for the first time, for this
reason it cannot run as a test case of another server
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
__author__ = 'Alessandro Pasotti'
__date__ = '01/04/2019'
__copyright__ = 'Copyright 2019, The QGIS Project'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'

import os

# Needed on Qt 5 so that the serialization of XML is consistent among all
# executions
os.environ['QT_HASH_SEED'] = '1'

from utilities import (
from qgis.testing import unittest

from test_qgsserver_wms import TestQgsServerWMSTestBase
from qgis.core import QgsProject, QgsFontUtils
from qgis.server import QgsServer

class TestQgsServerWMSLocaleOverride(TestQgsServerWMSTestBase):
"""QGIS Server WMS Tests for GetFeatureInfo request"""

# Set to True to re-generate reference files for this class
regenerate_reference = False

def setUp(self):
"""Create the server instance"""
self.fontFamily = QgsFontUtils.standardTestFontFamily()

self.testdata_path = unitTestDataPath('qgis_server') + '/'

d = unitTestDataPath('qgis_server') + '/'
self.projectPath = os.path.join(d, "project.qgs")

# Clean env just to be sure
for ev in env_vars:
del os.environ[ev]
except KeyError:


self.server = QgsServer()

def testGetFeatureInfoThousandSeparator(self):

'&layers=testlayer_thousands&styles=&' +
'info_format=text%2Fxml&transparent=true&' +
'width=600&height=400&srs=EPSG%3A3857&bbox=913190.6389747962%2C' +
'5606005.488876367%2C913235.426296057%2C5606035.347090538&' +

if __name__ == '__main__':

0 comments on commit 8a32848

Please sign in to comment.