Skip to content

Remove unused tests #10099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions readthedocs/proxito/tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,6 @@ def test_subproject_redirect(self):
resp["X-RTD-Redirect"], RedirectType.subproject_to_main_domain.name
)

# We are not canonicalizing custom domains -> public domain for now
@pytest.mark.xfail(strict=True)
def test_canonical_cname_redirect_public_domain(self):
"""Requests to a custom domain should redirect to the public domain or canonical domain if not canonical."""
cname = 'docs.random.com'
domain = get(Domain, project=self.pip, domain=cname, canonical=False, https=False)

resp = self.client.get(self.url, HTTP_HOST=cname)
self.assertEqual(resp.status_code, 302)
self.assertEqual(resp["X-RTD-Redirect"], "noncanonical-cname")

# Make the domain canonical and make sure we don't redirect
domain.canonical = True
domain.save()
for url in (self.url, '/subdir/'):
resp = self.client.get(url, HTTP_HOST=cname)
self.assertNotIn("X-RTD-Redirect", resp)

def test_proper_cname_uppercase(self):
get(Domain, project=self.pip, domain='docs.random.com')
request = self.request(method='get', path=self.url, HTTP_HOST='docs.RANDOM.COM')
Expand Down
20 changes: 0 additions & 20 deletions readthedocs/proxito/tests/test_redirects.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copied from .org test_redirects

import pytest
from django.test import override_settings

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

# We are not canonicalizing custom domains -> public domain for now
@pytest.mark.xfail(strict=True)
def test_canonicalize_cname_to_public_domain_redirect(self):
"""Redirect to the public domain if the CNAME is not canonical."""
r = self.client.get('/', HTTP_HOST=self.domain.domain)
self.assertEqual(r.status_code, 302)
self.assertEqual(
r['Location'], 'https://project.dev.readthedocs.io/en/latest/',
)
self.assertEqual(r['X-RTD-Redirect'], 'noncanonical-cname')

# We should redirect before 404ing
r = self.client.get('/en/latest/404after302', HTTP_HOST=self.domain2.domain)
self.assertEqual(r.status_code, 302)
self.assertEqual(
r['Location'], 'https://project.dev.readthedocs.io/en/latest/404after302',
)
self.assertEqual(r['X-RTD-Redirect'], 'noncanonical-cname')

# Specific Page Redirects
def test_proper_page_on_subdomain(self):
r = self.client.get('/page/test.html', HTTP_HOST='project.dev.readthedocs.io')
Expand Down