Skip to content
Permalink
Browse files

Set locale in the tests

  • Loading branch information
elpaso committed Jun 6, 2018
1 parent ec20ff7 commit e7df793d6ac0de7a0f4e5da5fc40854e7c33ce0f
Showing with 6 additions and 2 deletions.
  1. +6 −2 tests/src/python/test_qgsfieldformatters.py
@@ -266,8 +266,14 @@ def setUpClass(cls):
QCoreApplication.setOrganizationDomain("QGIS_TestPyQgsColorScheme.com")
QCoreApplication.setApplicationName("QGIS_TestPyQgsColorScheme")
QgsSettings().clear()
QLocale.setDefault(QLocale.c())
start_app()

@classmethod
def tearDownClass(cls):
"""Reset locale"""
QLocale.setDefault(QLocale.c())

def test_representValue(self):

layer = QgsVectorLayer("point?field=int:integer&field=double:double&field=long:long",
@@ -277,8 +283,6 @@ def test_representValue(self):

fieldFormatter = QgsRangeFieldFormatter()

QLocale.setDefault(QLocale.c())

# Precision is ignored for integers and longlongs
self.assertEqual(fieldFormatter.representValue(layer, 0, {'Precision': 1}, None, '123'), '123')
self.assertEqual(fieldFormatter.representValue(layer, 0, {'Precision': 1}, None, '123000'), '123000')

0 comments on commit e7df793

Please sign in to comment.
You can’t perform that action at this time.