|
1 | 1 | # Copied from .org test_redirects
|
2 | 2 |
|
3 |
| -import pytest |
4 | 3 | from django.test import override_settings
|
5 | 4 |
|
6 | 5 | from readthedocs.proxito.constants import RedirectType
|
@@ -203,25 +202,6 @@ def test_translation_secure_redirect(self):
|
203 | 202 | )
|
204 | 203 | self.assertEqual(r["X-RTD-Redirect"], RedirectType.system.name)
|
205 | 204 |
|
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 |
| - |
225 | 205 | # Specific Page Redirects
|
226 | 206 | def test_proper_page_on_subdomain(self):
|
227 | 207 | r = self.client.get('/page/test.html', HTTP_HOST='project.dev.readthedocs.io')
|
|
0 commit comments