changeset 249:d42e85b23272

`get_timezone_gmt()` wasn't getting the locale passed in all cases, which led to test errors when the default locale wasn't configured via environment variables.
author cmlenz
date Sun, 12 Aug 2007 19:19:43 +0000
parents 587b06d55323
children 194f927d8c5a
files babel/dates.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/babel/dates.py
+++ b/babel/dates.py
@@ -174,15 +174,15 @@
     as string indicating the offset from GMT.
     
     >>> dt = datetime(2007, 4, 1, 15, 30)
-    >>> get_timezone_gmt(dt)
+    >>> get_timezone_gmt(dt, locale='en')
     u'GMT+00:00'
     
     >>> from pytz import timezone
     >>> tz = timezone('America/Los_Angeles')
     >>> dt = datetime(2007, 4, 1, 15, 30, tzinfo=tz)
-    >>> get_timezone_gmt(dt)
+    >>> get_timezone_gmt(dt, locale='en')
     u'GMT-08:00'
-    >>> get_timezone_gmt(dt, 'short')
+    >>> get_timezone_gmt(dt, 'short', locale='en')
     u'-0800'
     
     The long format depends on the locale, for example in France a different
@@ -191,8 +191,8 @@
     >>> get_timezone_gmt(dt, 'long', locale='fr_FR')
     u'HMG-08:00'
     
-    :param dt: the ``datetime`` object; if `None`, the current date and time are
-               used
+    :param datetime: the ``datetime`` object; if `None`, the current date and
+                     time are used
     :param width: either "long" or "short"
     :param locale: the `Locale` object, or a locale string
     :return: the GMT offset representation of the timezone
@@ -799,7 +799,7 @@
         if char == 'z':
             return get_timezone_name(self.value, width, locale=self.locale)
         elif char == 'Z':
-            return get_timezone_gmt(self.value, width)
+            return get_timezone_gmt(self.value, width, locale=self.locale)
         elif char == 'v':
             return get_timezone_name(self.value.tzinfo, width,
                                      locale=self.locale)
Copyright (C) 2012-2017 Edgewall Software