summaryrefslogtreecommitdiff
path: root/dev-python/Babel/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-python/Babel/files
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-python/Babel/files')
-rw-r--r--dev-python/Babel/files/2.3-Fix-the-way-local-time-is-constructed-in-tests.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/dev-python/Babel/files/2.3-Fix-the-way-local-time-is-constructed-in-tests.patch b/dev-python/Babel/files/2.3-Fix-the-way-local-time-is-constructed-in-tests.patch
new file mode 100644
index 000000000000..fdfb31d7c62a
--- /dev/null
+++ b/dev-python/Babel/files/2.3-Fix-the-way-local-time-is-constructed-in-tests.patch
@@ -0,0 +1,30 @@
+From 476515c2418039e471656f47efbfc43e5230c1fd Mon Sep 17 00:00:00 2001
+From: Isaac Jurado <diptongo@gmail.com>
+Date: Sun, 29 May 2016 10:50:42 +0200
+Subject: [PATCH] Fix the way local time is constructed in tests
+
+In summer time zones, the test for "get_timezone_name" failed because the
+construct used to obtain a local time did not deal properly with DST offsets.
+As recommended by pytz, it is better to convert to local time from UTC.
+---
+ tests/test_dates.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test_dates.py b/tests/test_dates.py
+index 3bb9e8b..b0d093e 100644
+--- a/tests/test_dates.py
++++ b/tests/test_dates.py
+@@ -624,8 +624,9 @@ def test_get_timezone_name():
+ assert dates.get_timezone_name(tz, locale='en', width='long',
+ zone_variant='daylight') == u'Pacific Daylight Time'
+
++ localnow = datetime.utcnow().replace(tzinfo=timezone('UTC')).astimezone(dates.LOCALTZ)
+ assert (dates.get_timezone_name(None, locale='en_US') ==
+- dates.get_timezone_name(datetime.now().replace(tzinfo=dates.LOCALTZ), locale='en_US'))
++ dates.get_timezone_name(localnow, locale='en_US'))
+
+ assert (dates.get_timezone_name('Europe/Berlin', locale='en_US') == "Central European Time")
+
+--
+2.13.0
+