Skip to content

Commit

Permalink
Set locale in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jun 9, 2018
1 parent ec20ff7 commit e7df793
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/src/python/test_qgsfieldformatters.py
Expand Up @@ -266,8 +266,14 @@ def setUpClass(cls):
QCoreApplication.setOrganizationDomain("QGIS_TestPyQgsColorScheme.com") QCoreApplication.setOrganizationDomain("QGIS_TestPyQgsColorScheme.com")
QCoreApplication.setApplicationName("QGIS_TestPyQgsColorScheme") QCoreApplication.setApplicationName("QGIS_TestPyQgsColorScheme")
QgsSettings().clear() QgsSettings().clear()
QLocale.setDefault(QLocale.c())
start_app() start_app()


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

def test_representValue(self): def test_representValue(self):


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


fieldFormatter = QgsRangeFieldFormatter() fieldFormatter = QgsRangeFieldFormatter()


QLocale.setDefault(QLocale.c())

# Precision is ignored for integers and longlongs # 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, '123'), '123')
self.assertEqual(fieldFormatter.representValue(layer, 0, {'Precision': 1}, None, '123000'), '123000') self.assertEqual(fieldFormatter.representValue(layer, 0, {'Precision': 1}, None, '123000'), '123000')
Expand Down

0 comments on commit e7df793

Please sign in to comment.