Skip to content

Commit e4c0c07

Browse files
committed
Use https explicitly
1 parent b10c8b8 commit e4c0c07

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
+7-4
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
# Copied from .org test_redirects
22

33

4+
from django.test import override_settings
5+
46
from .base import BaseDocServing
57

68

9+
@override_settings(PUBLIC_DOMAIN_USES_HTTPS=True)
710
class RedirectTests(BaseDocServing):
811

912
def test_root_url(self):
1013
r = self.client.get('/', HTTP_HOST='project.dev.readthedocs.io')
1114
self.assertEqual(r.status_code, 302)
1215
self.assertEqual(
13-
r['Location'], 'http://project.dev.readthedocs.io/en/latest/',
16+
r['Location'], 'https://project.dev.readthedocs.io/en/latest/',
1417
)
1518

1619
def test_subproject_root_url(self):
1720
r = self.client.get('/projects/subproject/', HTTP_HOST='project.dev.readthedocs.io')
1821
self.assertEqual(r.status_code, 302)
1922
self.assertEqual(
20-
r['Location'], 'http://project.dev.readthedocs.io/projects/subproject/en/latest/',
23+
r['Location'], 'https://project.dev.readthedocs.io/projects/subproject/en/latest/',
2124
)
2225

2326
def test_root_redirect_with_query_params(self):
2427
r = self.client.get('/?foo=bar', HTTP_HOST='project.dev.readthedocs.io')
2528
self.assertEqual(r.status_code, 302)
2629
self.assertEqual(
2730
r['Location'],
28-
'http://project.dev.readthedocs.io/en/latest/?foo=bar'
31+
'https://project.dev.readthedocs.io/en/latest/?foo=bar'
2932
)
3033

3134
# Specific Page Redirects
@@ -34,5 +37,5 @@ def test_proper_page_on_subdomain(self):
3437
self.assertEqual(r.status_code, 302)
3538
self.assertEqual(
3639
r['Location'],
37-
'http://project.dev.readthedocs.io/en/latest/test.html',
40+
'https://project.dev.readthedocs.io/en/latest/test.html',
3841
)

0 commit comments

Comments
 (0)