Skip to content

Commit cd8f2da

Browse files
authored
Remove unused tests (#10099)
Ref #10027 (comment)
1 parent 12be8a7 commit cd8f2da

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

readthedocs/proxito/tests/test_middleware.py

-18
Original file line numberDiff line numberDiff line change
@@ -123,24 +123,6 @@ def test_subproject_redirect(self):
123123
resp["X-RTD-Redirect"], RedirectType.subproject_to_main_domain.name
124124
)
125125

126-
# We are not canonicalizing custom domains -> public domain for now
127-
@pytest.mark.xfail(strict=True)
128-
def test_canonical_cname_redirect_public_domain(self):
129-
"""Requests to a custom domain should redirect to the public domain or canonical domain if not canonical."""
130-
cname = 'docs.random.com'
131-
domain = get(Domain, project=self.pip, domain=cname, canonical=False, https=False)
132-
133-
resp = self.client.get(self.url, HTTP_HOST=cname)
134-
self.assertEqual(resp.status_code, 302)
135-
self.assertEqual(resp["X-RTD-Redirect"], "noncanonical-cname")
136-
137-
# Make the domain canonical and make sure we don't redirect
138-
domain.canonical = True
139-
domain.save()
140-
for url in (self.url, '/subdir/'):
141-
resp = self.client.get(url, HTTP_HOST=cname)
142-
self.assertNotIn("X-RTD-Redirect", resp)
143-
144126
def test_proper_cname_uppercase(self):
145127
get(Domain, project=self.pip, domain='docs.random.com')
146128
request = self.request(method='get', path=self.url, HTTP_HOST='docs.RANDOM.COM')

readthedocs/proxito/tests/test_redirects.py

-20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Copied from .org test_redirects
22

3-
import pytest
43
from django.test import override_settings
54

65
from readthedocs.proxito.constants import RedirectType
@@ -203,25 +202,6 @@ def test_translation_secure_redirect(self):
203202
)
204203
self.assertEqual(r["X-RTD-Redirect"], RedirectType.system.name)
205204

206-
# We are not canonicalizing custom domains -> public domain for now
207-
@pytest.mark.xfail(strict=True)
208-
def test_canonicalize_cname_to_public_domain_redirect(self):
209-
"""Redirect to the public domain if the CNAME is not canonical."""
210-
r = self.client.get('/', HTTP_HOST=self.domain.domain)
211-
self.assertEqual(r.status_code, 302)
212-
self.assertEqual(
213-
r['Location'], 'https://project.dev.readthedocs.io/en/latest/',
214-
)
215-
self.assertEqual(r['X-RTD-Redirect'], 'noncanonical-cname')
216-
217-
# We should redirect before 404ing
218-
r = self.client.get('/en/latest/404after302', HTTP_HOST=self.domain2.domain)
219-
self.assertEqual(r.status_code, 302)
220-
self.assertEqual(
221-
r['Location'], 'https://project.dev.readthedocs.io/en/latest/404after302',
222-
)
223-
self.assertEqual(r['X-RTD-Redirect'], 'noncanonical-cname')
224-
225205
# Specific Page Redirects
226206
def test_proper_page_on_subdomain(self):
227207
r = self.client.get('/page/test.html', HTTP_HOST='project.dev.readthedocs.io')

0 commit comments

Comments
 (0)