]> review.fuel-infra Code Review - openstack-build/horizon-build.git/commitdiff
Added fix-assertRedirects-no-longer-forced-absolute-URLs.patch.
authorThomas Goirand <thomas@goirand.fr>
Mon, 11 Jan 2016 13:25:05 +0000 (13:25 +0000)
committerThomas Goirand <thomas@goirand.fr>
Mon, 11 Jan 2016 13:25:05 +0000 (13:25 +0000)
Rewritten-From: b1251e9b630b00e309988779eae15fb8a80ead41

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

index 83c915e7c4c0fc2186e5d932cb64f2ec99bdb80d..c06da759820d630d13a0b3657823a3c5d4ddbd28 100644 (file)
@@ -10,6 +10,7 @@ horizon (2:8.0.0-4) unstable; urgency=medium
   * Added django.template.base.library-moved.patch.
   * Added fix-request.REQUEST-does-not-exist.patch.
   * Added remove-load-url-from-future.patch.
+  * Added fix-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/0140-fix-assertRedirects-no-longer-forced-absolute-URLs.patch b/trusty/debian/patches/0140-fix-assertRedirects-no-longer-forced-absolute-URLs.patch
new file mode 100644 (file)
index 0000000..bcd1e68
--- /dev/null
@@ -0,0 +1,33 @@
+Description: Fix assertRedirects no longer forced absolute URLs
+ As per:
+ https://docs.djangoproject.com/en/1.9/releases/1.9/#http-redirects-no-longer-forced-to-absolute-uris
+ Django 1.9 no longer forces absolute URIs.
+Author: Thomas Goirand <zigo@debian.org>
+Forwarded: no
+Last-Update: 2016-01-11
+
+--- horizon-8.0.0.orig/openstack_dashboard/test/helpers.py
++++ horizon-8.0.0/openstack_dashboard/test/helpers.py
+@@ -25,6 +25,7 @@ import os
+ from ceilometerclient.v2 import client as ceilometer_client
+ from cinderclient import client as cinder_client
++import django
+ from django.conf import settings
+ from django.contrib.messages.storage import default_storage  # noqa
+ from django.core.handlers import wsgi
+@@ -227,8 +228,12 @@ class TestCase(horizon_helpers.TestCase)
+         Asserts that the given response issued a 302 redirect without
+         processing the view which is redirected to.
+         """
+-        self.assertEqual(response._headers.get('location', None),
+-                         ('Location', settings.TESTSERVER + expected_url))
++        if django.get_version() >= '1.9':
++            self.assertEqual(response._headers.get('location', None),
++                ('Location', expected_url))
++        else:
++            self.assertEqual(response._headers.get('location', None),
++                             ('Location', settings.TESTSERVER + expected_url))
+         self.assertEqual(response.status_code, 302)
+     def assertNoFormErrors(self, response, context_name="form"):
index 14e395b0b8f1712e9abec937b90cf0ef3f3967b6..07a9f6c6bd837665fccdc03af9e8b3b2284069ca 100644 (file)
@@ -11,3 +11,4 @@
 0110-django.template.base.library-moved.patch
 0120-fix-request.REQUEST-does-not-exist.patch
 0130-remove-load-url-from-future.patch
+0140-fix-assertRedirects-no-longer-forced-absolute-URLs.patch