[Python-modules-commits] r22412 - in packages/webhelpers/trunk/debian (5 files)
piotr at users.alioth.debian.org
piotr at users.alioth.debian.org
Sat Jul 7 18:03:13 UTC 2012
Date: Saturday, July 7, 2012 @ 18:03:05
Author: piotr
Revision: 22412
* Handle API change in WebOb 1.1.1 (thanks to Colin Watson for the patch
from Ubuntu)
* Disable distance_of_time_in_words tests (Closes: 629699)
Added:
packages/webhelpers/trunk/debian/patches/
packages/webhelpers/trunk/debian/patches/disabled_tests.patch
packages/webhelpers/trunk/debian/patches/series
packages/webhelpers/trunk/debian/patches/webob_1.1.1.patch
Modified:
packages/webhelpers/trunk/debian/changelog
Modified: packages/webhelpers/trunk/debian/changelog
===================================================================
--- packages/webhelpers/trunk/debian/changelog 2012-07-07 01:12:38 UTC (rev 22411)
+++ packages/webhelpers/trunk/debian/changelog 2012-07-07 18:03:05 UTC (rev 22412)
@@ -1,3 +1,11 @@
+webhelpers (1.3-3) unstable; urgency=low
+
+ * Handle API change in WebOb 1.1.1 (thanks to Colin Watson for the patch
+ from Ubuntu)
+ * Disable distance_of_time_in_words tests (Closes: 629699)
+
+ -- Piotr Ożarowski <piotr at debian.org> Sat, 07 Jul 2012 19:13:26 +0200
+
webhelpers (1.3-2) unstable; urgency=low
[ Andrey Rahmatullin ]
Added: packages/webhelpers/trunk/debian/patches/disabled_tests.patch
===================================================================
--- packages/webhelpers/trunk/debian/patches/disabled_tests.patch (rev 0)
+++ packages/webhelpers/trunk/debian/patches/disabled_tests.patch 2012-07-07 18:03:05 UTC (rev 22412)
@@ -0,0 +1,32 @@
+Description: disable some tests that fail depending on the current date/timezone
+ to reproduce:
+ $ export TZ=Europe/Warsaw
+ $ for d in 01-01 03-01 03-02 03-27 04-02 10-30; do faketime "2011-$d UTC" python -c 'import webhelpers.date as d; print d.distance_of_time_in_words(0, 31536000)'; done
+Author: Piotr Ożarowski <piotr at debian.org>
+Bug-Debian: http://bugs.debian.org/629699
+Forwarded: no
+Last-Update: 2012-07-07
+
+Index: webhelpers-1.3/tests/test_date.py
+===================================================================
+--- webhelpers-1.3.orig/tests/test_date.py
++++ webhelpers-1.3/tests/test_date.py
+@@ -17,12 +17,12 @@ class TestDateHelper(WebHelpersTestCase)
+ # now". Depending on when the test is run, the interval may include a
+ # leap year. The 'try' assumes it's not a leap year, the 'except'
+ # tries it again as a leap year.
+- try:
+- self.assertEqual("1 year", distance_of_time_in_words(0, 31536000))
+- self.assertEqual("1 year", distance_of_time_in_words(1, 31536001))
+- except AssertionError: # If the intervening year contains February 29th
+- self.assertEqual("11 months and 30 days", distance_of_time_in_words(0, 31536000))
+- self.assertEqual("11 months and 30 days", distance_of_time_in_words(1, 31536001))
++ #try:
++ # self.assertEqual("1 year", distance_of_time_in_words(0, 31536000))
++ # self.assertEqual("1 year", distance_of_time_in_words(1, 31536001))
++ #except AssertionError: # If the intervening year contains February 29th
++ # self.assertEqual("11 months and 30 days", distance_of_time_in_words(0, 31536000))
++ # self.assertEqual("11 months and 30 days", distance_of_time_in_words(1, 31536001))
+
+ # Granularity is invalid
+ self.assertRaises(Exception, distance_of_time_in_words, 0, 1, 'blah')
Added: packages/webhelpers/trunk/debian/patches/series
===================================================================
--- packages/webhelpers/trunk/debian/patches/series (rev 0)
+++ packages/webhelpers/trunk/debian/patches/series 2012-07-07 18:03:05 UTC (rev 22412)
@@ -0,0 +1,2 @@
+disabled_tests.patch
+webob_1.1.1.patch
Added: packages/webhelpers/trunk/debian/patches/webob_1.1.1.patch
===================================================================
--- packages/webhelpers/trunk/debian/patches/webob_1.1.1.patch (rev 0)
+++ packages/webhelpers/trunk/debian/patches/webob_1.1.1.patch 2012-07-07 18:03:05 UTC (rev 22412)
@@ -0,0 +1,28 @@
+Description: Handle API change in WebOb 1.1.1
+Author: Colin Watson <cjwatson at ubuntu.com>
+Bug-Debian: http://bugs.debian.org/629699
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/910766
+Forwarded: no
+Last-Update: 2012-04-20
+
+Index: b/webhelpers/mimehelper.py
+===================================================================
+--- a/webhelpers/mimehelper.py
++++ b/webhelpers/mimehelper.py
+@@ -110,8 +110,14 @@
+ if '.' in last_part:
+ has_extension = True
+ if 'HTTP_ACCEPT' in self.env:
+- possible_from_accept_header = webob.acceptparse.MIMEAccept('ACCEPT',
+- self.env['HTTP_ACCEPT'])
++ try:
++ # WebOb >= 1.1.1
++ possible_from_accept_header = webob.acceptparse.MIMEAccept(
++ self.env['HTTP_ACCEPT'])
++ except TypeError:
++ # WebOb < 1.1.1
++ possible_from_accept_header = webob.acceptparse.MIMEAccept('ACCEPT',
++ self.env['HTTP_ACCEPT'])
+ if has_extension == False:
+ if possible_from_accept_header is None:
+ return self._set_response_content_type(content_type)
More information about the Python-modules-commits
mailing list