tests(contrib/settings): Use assertRedirects in tests

Required to make tests work on Django 1.9: https://docs.djangoproject.com/en/1.9/releases/1.9/#http-redirects-no-longer-forced-to-absolute-uris
pull/1990/merge
Karl Hobley 2015-12-03 10:06:38 +00:00 zatwierdzone przez Matt Westcott
rodzic 4091883b14
commit b38579495c
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -130,7 +130,7 @@ class TestMultiSite(BaseTestSettingView):
dest_url = 'http://testserver' + reverse('wagtailsettings:edit', args=[
self.default_site.pk, 'tests', 'testsetting'])
response = self.client.get(start_url, follow=True)
self.assertEqual([(dest_url, 302)], response.redirect_chain)
self.assertRedirects(response, dest_url, status_code=302, fetch_redirect_response=False)
def test_redirect_to_current(self):
"""
@ -142,7 +142,7 @@ class TestMultiSite(BaseTestSettingView):
dest_url = 'http://example.com' + reverse('wagtailsettings:edit', args=[
self.other_site.pk, 'tests', 'testsetting'])
response = self.client.get(start_url, follow=True, HTTP_HOST=self.other_site.hostname)
self.assertEqual([(dest_url, 302)], response.redirect_chain)
self.assertRedirects(response, dest_url, status_code=302, fetch_redirect_response=False)
def test_with_no_current_site(self):
"""