kopia lustrzana https://github.com/wagtail/wagtail
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-urispull/1990/merge
rodzic
4091883b14
commit
b38579495c
|
@ -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):
|
||||
"""
|
||||
|
|
Ładowanie…
Reference in New Issue