Author: cito
Date: Fri Nov 20 16:44:55 2015
New Revision: 565

Log:
Using a better locale name for tests

In the test we need to force Postgres to use a money format that does
not use a dot as decimal point. Maybe we should try several common
locale names to get this test running on different platforms?

Modified:
   branches/4.x/module/TEST_PyGreSQL_classic_connection.py
   trunk/module/TEST_PyGreSQL_classic_connection.py

Modified: branches/4.x/module/TEST_PyGreSQL_classic_connection.py
==============================================================================
--- branches/4.x/module/TEST_PyGreSQL_classic_connection.py     Fri Nov 20 
16:18:07 2015        (r564)
+++ branches/4.x/module/TEST_PyGreSQL_classic_connection.py     Fri Nov 20 
16:44:55 2015        (r565)
@@ -918,7 +918,7 @@
         # check that money values can be interpreted correctly
         # if and only if the decimal point is set appropriately
         # for the current lc_monetary setting
-        query("set lc_monetary='en_US'")
+        query("set lc_monetary='en_US.UTF-8'")
         pg.set_decimal_point('.')
         r = query("select '34.25'::money").getresult()[0][0]
         self.assertIsInstance(r, d)
@@ -926,7 +926,7 @@
         pg.set_decimal_point(',')
         r = query("select '34.25'::money").getresult()[0][0]
         self.assertNotEqual(r, d('34.25'))
-        query("set lc_monetary='de_DE'")
+        query("set lc_monetary='de_DE.UTF-8'")
         pg.set_decimal_point(',')
         r = query("select '34,25'::money").getresult()[0][0]
         self.assertIsInstance(r, d)

Modified: trunk/module/TEST_PyGreSQL_classic_connection.py
==============================================================================
--- trunk/module/TEST_PyGreSQL_classic_connection.py    Fri Nov 20 16:18:07 
2015        (r564)
+++ trunk/module/TEST_PyGreSQL_classic_connection.py    Fri Nov 20 16:44:55 
2015        (r565)
@@ -922,7 +922,7 @@
         # check that money values can be interpreted correctly
         # if and only if the decimal point is set appropriately
         # for the current lc_monetary setting
-        query("set lc_monetary='en_US'")
+        query("set lc_monetary='en_US.UTF-8'")
         pg.set_decimal_point('.')
         r = query("select '34.25'::money").getresult()[0][0]
         self.assertIsInstance(r, d)
@@ -930,7 +930,7 @@
         pg.set_decimal_point(',')
         r = query("select '34.25'::money").getresult()[0][0]
         self.assertNotEqual(r, d('34.25'))
-        query("set lc_monetary='de_DE'")
+        query("set lc_monetary='de_DE.UTF-8'")
         pg.set_decimal_point(',')
         r = query("select '34,25'::money").getresult()[0][0]
         self.assertIsInstance(r, d)
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to