]> review.fuel-infra Code Review - openstack-build/horizon-build.git/commitdiff
Added fix-another-assertRedirects-no-longer-forced-absolute-URLs.patch. anonscm.debian.org/debian/liberty/for-trusty
authorThomas Goirand <thomas@goirand.fr>
Tue, 12 Jan 2016 07:24:37 +0000 (07:24 +0000)
committerThomas Goirand <thomas@goirand.fr>
Tue, 12 Jan 2016 08:33:27 +0000 (08:33 +0000)
Rewritten-From: e49f8d20906b851c9068d481d714ac5de0c9fc18

trusty/debian/changelog
trusty/debian/patches/0160-fix-another-assertRedirects-no-longer-forced-absolute-URLs.patch [new file with mode: 0644]
trusty/debian/patches/series

index 3a86531b9741eb84c64a1a71bb005452070010fa..e45d2ed68f4d863a739053c099ede3454f18403d 100644 (file)
@@ -12,6 +12,7 @@ horizon (2:8.0.0-4) unstable; urgency=medium
   * Added remove-load-url-from-future.patch.
   * Added fix-assertRedirects-no-longer-forced-absolute-URLs.patch.
   * Added removed-redefinition-of-get_traceback_frame_variables.patch.
+  * Added fix-another-assertRedirects-no-longer-forced-absolute-URLs.patch.
 
  -- Thomas Goirand <zigo@debian.org>  Mon, 11 Jan 2016 02:54:28 +0000
 
diff --git a/trusty/debian/patches/0160-fix-another-assertRedirects-no-longer-forced-absolute-URLs.patch b/trusty/debian/patches/0160-fix-another-assertRedirects-no-longer-forced-absolute-URLs.patch
new file mode 100644 (file)
index 0000000..b0ba475
--- /dev/null
@@ -0,0 +1,58 @@
+Description: Fix another assertRedirects
+Author: Thomas Goirand <zigo@debian.org>
+Forwarded: no
+Last-Update: 2016-01-12
+
+--- horizon-8.0.0.orig/horizon/test/tests/base.py
++++ horizon-8.0.0/horizon/test/tests/base.py
+@@ -17,6 +17,7 @@
+ #    License for the specific language governing permissions and limitations
+ #    under the License.
++import django
+ from django.conf import settings
+ from django.contrib.auth.models import User  # noqa
+ from django.core.exceptions import ImproperlyConfigured  # noqa
+@@ -303,8 +304,12 @@ class HorizonTests(BaseHorizonTests):
+         dogs = horizon.get_dashboard("dogs")
+         puppies = dogs.get_panel("puppies")
+         url = puppies.get_absolute_url()
+-        redirect_url = "?".join([settings.LOGIN_URL,
+-                                 "next=%s" % url])
++        if django.get_version() >= '1.9':
++            redirect_url = "http://testserver" + "?".join([settings.LOGIN_URL,
++                                                          "next=%s" % url])
++        else:
++            redirect_url = "?".join([settings.LOGIN_URL,
++                                     "next=%s" % url])
+         self.client.logout()
+         resp = self.client.get(url)
+@@ -316,6 +321,8 @@ class HorizonTests(BaseHorizonTests):
+         resp = self.client.get(url, HTTP_X_FORWARDED_PROTOCOL="https")
+         self.assertEqual(302, resp.status_code)
++        redirect_url = "?".join([settings.LOGIN_URL,
++                                "next=%s" % url])
+         self.assertEqual('https://testserver:80%s' % redirect_url,
+                          resp['location'])
+--- horizon-8.0.0.orig/horizon/test/tests/middleware.py
++++ horizon-8.0.0/horizon/test/tests/middleware.py
+@@ -15,6 +15,7 @@
+ import time
++import django
+ from django.conf import settings
+ from django.http import HttpResponseRedirect  # noqa
+@@ -33,6 +34,8 @@ class MiddlewareTests(test.TestCase):
+         resp = mw.process_exception(request, exceptions.NotAuthorized())
+         resp.client = self.client
++        if django.get_version() >= '1.9':
++            url = "http://testserver" + url
+         self.assertRedirects(resp, url)
+     def test_session_timeout(self):
index aab60c24c1a1d8fb56440a62894ee8d470fae8cd..8dbaf4861ad27ae7d1b5c359300534c120d47220 100644 (file)
@@ -13,3 +13,4 @@
 0130-remove-load-url-from-future.patch
 0140-fix-assertRedirects-no-longer-forced-absolute-URLs.patch
 0150-removed-redefinition-of-get_traceback_frame_variables.patch
+0160-fix-another-assertRedirects-no-longer-forced-absolute-URLs.patch