Skip to content

Commit

Permalink
Django 1.9+ doesn't force absolute URL for the Location header for re…
Browse files Browse the repository at this point in the history
…direct responses. See #83
  • Loading branch information
aarranz committed Jan 20, 2016
1 parent 878396e commit 28d1bba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/wirecloud/platform/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import json
from lxml import etree

import django
from django.core.urlresolvers import reverse
from django.test import Client
from django.test.client import RequestFactory
Expand Down Expand Up @@ -65,7 +66,12 @@ def setUpClass(cls):
super(BasicViewsAPI, cls).setUpClass()
factory = RequestFactory()
request = factory.get(reverse('login'))
cls.login_url = get_absolute_reverse_url('login', request=request)
if django.VERSION[1] >= 9:
# Django 1.9 doesn't force the use of absolute urls for the location header
# https://docs.djangoproject.com/en/1.9/releases/1.9/#http-redirects-no-longer-forced-to-absolute-uris
cls.login_url = reverse('login')
else:
cls.login_url = get_absolute_reverse_url('login', request=request)

def test_workspace_view_redirects_to_login(self):

Expand Down

0 comments on commit 28d1bba

Please sign in to comment.