[python-flask-babel] Add patch to work with latest Babel (#1106770).

pcpa pcpa at fedoraproject.org
Thu Jul 17 12:54:31 UTC 2014


commit b6807c17e90a2663be79e68150f6b4cb610a2af1
Author: pcpa <paulo.cesar.pereira.de.andrade at gmail.com>
Date:   Thu Jul 17 09:54:49 2014 -0300

    Add patch to work with latest Babel (#1106770).

 python-flask-babel-tests.patch |   57 ++++++++++++++++++++++++++++++++++++++++
 python-flask-babel.spec        |   10 ++++++-
 2 files changed, 66 insertions(+), 1 deletions(-)
---
diff --git a/python-flask-babel-tests.patch b/python-flask-babel-tests.patch
new file mode 100644
index 0000000..789080d
--- /dev/null
+++ b/python-flask-babel-tests.patch
@@ -0,0 +1,57 @@
+diff -up Flask-Babel-0.8/tests/tests.py.orig Flask-Babel-0.8/tests/tests.py
+--- Flask-Babel-0.8/tests/tests.py.orig	2014-07-17 09:46:54.630548512 -0300
++++ Flask-Babel-0.8/tests/tests.py	2014-07-17 09:48:25.164551978 -0300
+@@ -21,13 +21,13 @@ class DateFormattingTestCase(unittest.Te
+         d = datetime(2010, 4, 12, 13, 46)
+ 
+         with app.test_request_context():
+-            assert babel.format_datetime(d) == 'Apr 12, 2010 1:46:00 PM'
++            assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00 PM'
+             assert babel.format_date(d) == 'Apr 12, 2010'
+             assert babel.format_time(d) == '1:46:00 PM'
+ 
+         with app.test_request_context():
+             app.config['BABEL_DEFAULT_TIMEZONE'] = 'Europe/Vienna'
+-            assert babel.format_datetime(d) == 'Apr 12, 2010 3:46:00 PM'
++            assert babel.format_datetime(d) == 'Apr 12, 2010, 3:46:00 PM'
+             assert babel.format_date(d) == 'Apr 12, 2010'
+             assert babel.format_time(d) == '3:46:00 PM'
+ 
+@@ -43,13 +43,13 @@ class DateFormattingTestCase(unittest.Te
+         d = datetime(2010, 4, 12, 13, 46)
+ 
+         with app.test_request_context():
+-            assert babel.format_datetime(d) == 'Apr 12, 2010 1:46:00 PM'
++            assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00 PM'
+             assert babel.format_date(d) == 'Apr 12, 2010'
+             assert babel.format_time(d) == '1:46:00 PM'
+ 
+         with app.test_request_context():
+             app.config['BABEL_DEFAULT_TIMEZONE'] = 'Europe/Vienna'
+-            assert babel.format_datetime(d) == 'Apr 12, 2010 3:46:00 PM'
++            assert babel.format_datetime(d) == 'Apr 12, 2010, 3:46:00 PM'
+             assert babel.format_date(d) == 'Apr 12, 2010'
+             assert babel.format_time(d) == '3:46:00 PM'
+ 
+@@ -88,7 +88,7 @@ class DateFormattingTestCase(unittest.Te
+             return the_timezone
+ 
+         with app.test_request_context():
+-            assert babel.format_datetime(d) == 'Apr 12, 2010 1:46:00 PM'
++            assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00 PM'
+ 
+         the_locale = 'de_DE'
+         the_timezone = 'Europe/Vienna'
+@@ -101,10 +101,10 @@ class DateFormattingTestCase(unittest.Te
+         b = babel.Babel(app)
+         d = datetime(2010, 4, 12, 13, 46)
+         with app.test_request_context():
+-            assert babel.format_datetime(d) == 'Apr 12, 2010 1:46:00 PM'
++            assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00 PM'
+             app.config['BABEL_DEFAULT_TIMEZONE'] = 'Europe/Vienna'
+             babel.refresh()
+-            assert babel.format_datetime(d) == 'Apr 12, 2010 3:46:00 PM'
++            assert babel.format_datetime(d) == 'Apr 12, 2010, 3:46:00 PM'
+ 
+ 
+ class NumberFormattingTestCase(unittest.TestCase):
diff --git a/python-flask-babel.spec b/python-flask-babel.spec
index 1f944fa..e96f3bf 100644
--- a/python-flask-babel.spec
+++ b/python-flask-babel.spec
@@ -2,13 +2,17 @@
 
 Name:		python-flask-babel
 Version:	0.8
-Release:	7%{?dist}
+Release:	8%{?dist}
 Summary:	Adds i18n/l10n support to Flask applications
 Group:		Development/Libraries
 License:	BSD
 URL:		http://github.com/mitsuhiko/flask-babel/
 Source0:	http://pypi.python.org/packages/source/F/%{mod_name}/%{mod_name}-%{version}.tar.gz
 BuildArch:	noarch
+
+# https://github.com/mitsuhiko/flask-babel/issues/58
+Patch0:		%{name}-tests.patch
+
 BuildRequires:	python-babel
 BuildRequires:	python-devel
 BuildRequires:	python-flask
@@ -25,6 +29,7 @@ Adds i18n/l10n support to Flask applications with the help of the Babel library.
 
 %prep
 %setup -q -n %{mod_name}-%{version}
+%patch0 -p1
 
 %build
 %{__python} setup.py build
@@ -43,6 +48,9 @@ PYTHONPATH=$RPM_BUILD_ROOT/%{python_sitelib}:%{python_sitelib} make test
 %{python_sitelib}/flaskext/*.py*
 
 %changelog
+* Thu Jul 17 2014 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 0.8-6
+- Add patch to work with latest Babel (#1106770).
+
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.8-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 


More information about the scm-commits mailing list