[FIX] attempt to fix issues of Locale.parse(None) returning None
use Locale.default() instead of manually parsing the result of locale.getdefaultlocale() bzr revid: xmo@openerp.com-20131213104030-0tejn7i13yex975v
This commit is contained in:
parent
0546993327
commit
3b56c80ced
|
@ -40,7 +40,6 @@ class test_countingstream(unittest2.TestCase):
|
|||
self.assertIsNone(next(s, None))
|
||||
self.assertEqual(s.index, 0)
|
||||
|
||||
lname, _ = locale.getdefaultlocale()
|
||||
class TestPosixToBabel(unittest2.TestCase):
|
||||
def setUp(self):
|
||||
super(TestPosixToBabel, self).setUp()
|
||||
|
@ -49,10 +48,11 @@ class TestPosixToBabel(unittest2.TestCase):
|
|||
def assert_eq(self, fmt, d=None):
|
||||
if d is None: d = self.d
|
||||
|
||||
ldml_format = misc.posix_to_ldml(fmt, locale=babel.Locale.parse(lname))
|
||||
locale = babel.Locale.default('LC_TIME')
|
||||
ldml_format = misc.posix_to_ldml(fmt, locale=locale)
|
||||
self.assertEqual(
|
||||
d.strftime(fmt),
|
||||
babel.dates.format_datetime(d, format=ldml_format),
|
||||
babel.dates.format_datetime(d, format=ldml_format, locale=locale),
|
||||
"%r resulted in a different result than %r for %s" % (
|
||||
ldml_format, fmt, d))
|
||||
|
||||
|
|
Loading…
Reference in New Issue