|
12 | 12 |
|
13 | 13 | from readthedocs.core.views.serve import _serve_symlink_docs
|
14 | 14 | from readthedocs.builds.constants import STABLE
|
15 |
| -from readthedocs.builds.models import Versionfrom readthedocs.projects import constants |
| 15 | +from readthedocs.builds.models import Version |
| 16 | +from readthedocs.projects import constants |
16 | 17 | from readthedocs.projects.models import Project
|
17 | 18 | from readthedocs.rtd_tests.base import RequestFactoryTestMixin
|
18 | 19 |
|
@@ -198,36 +199,6 @@ def test_custom_robots_txt(self, os_mock, open_mock):
|
198 | 199 | PUBLIC_DOMAIN='readthedocs.io',
|
199 | 200 | ROOT_URLCONF=settings.SUBDOMAIN_URLCONF,
|
200 | 201 | )
|
201 |
| - def test_default_robots_txt(self): |
202 |
| - self.public.versions.update(active=True, built=True) |
203 |
| - self.public.versions.filter(slug=STABLE).update(privacy_level=constants.PRIVATE) |
204 |
| - response = self.client.get( |
205 |
| - reverse('sitemap_xml'), |
206 |
| - HTTP_HOST='public.readthedocs.io', |
207 |
| - ) |
208 |
| - self.assertEqual(response.status_code, 200) |
209 |
| - self.assertEqual(response.content_type, 'application/xml') |
210 |
| - for version in self.public.versions.filter(privacy_level=constants.PUBLIC): |
211 |
| - self.assertContains( |
212 |
| - response, |
213 |
| - self.public.get_docs_url( |
214 |
| - version_slug=version.slug, |
215 |
| - lang_slug=self.project.language, |
216 |
| - private=False, |
217 |
| - ), |
218 |
| - ) |
219 |
| - |
220 |
| - # stable is marked as PRIVATE and should not appear here |
221 |
| - stable = self.public.versions.get(slug=STABLE) |
222 |
| - self.assertNotContains( |
223 |
| - response, |
224 |
| - self.public.get_docs_url( |
225 |
| - version_slug=stable.slug, |
226 |
| - lang_slug=self.project.language, |
227 |
| - private=True, |
228 |
| - ), |
229 |
| - ) |
230 |
| - |
231 | 202 | def test_sitemap_xml(self):
|
232 | 203 | self.public.versions.update(active=True)
|
233 | 204 | private_version = fixture.get(
|
|
0 commit comments