Skip to content

Commit dc5448b

Browse files
committed
Remove more settings, command and test class
1 parent 9518912 commit dc5448b

File tree

6 files changed

+8
-73
lines changed

6 files changed

+8
-73
lines changed

readthedocs/core/management/commands/archive.py

-39
This file was deleted.

readthedocs/rtd_tests/base.py

-19
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# -*- coding: utf-8 -*-
22
"""Base classes and mixins for unit tests."""
33
import logging
4-
import os
5-
import shutil
6-
import tempfile
74
from collections import OrderedDict
85

9-
from django.conf import settings
106
from django.contrib.auth.models import AnonymousUser
117
from django.contrib.messages.storage.fallback import FallbackStorage
128
from django.contrib.sessions.middleware import SessionMiddleware
@@ -17,21 +13,6 @@
1713
log = logging.getLogger(__name__)
1814

1915

20-
class RTDTestCase(TestCase):
21-
def setUp(self):
22-
self.original_DOCROOT = settings.DOCROOT
23-
self.cwd = os.path.dirname(__file__)
24-
self.build_dir = tempfile.mkdtemp()
25-
log.info('build dir: %s', self.build_dir)
26-
if not os.path.exists(self.build_dir):
27-
os.makedirs(self.build_dir)
28-
settings.DOCROOT = self.build_dir
29-
30-
def tearDown(self):
31-
shutil.rmtree(self.build_dir)
32-
settings.DOCROOT = self.original_DOCROOT
33-
34-
3516
@patch('readthedocs.projects.views.private.trigger_build', lambda x: None)
3617
@patch('readthedocs.projects.views.private.trigger_build', lambda x: None)
3718
class MockBuildTestCase(TestCase):

readthedocs/rtd_tests/tests/test_backend.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from tempfile import mkdtemp
66
import textwrap
77

8+
from django.test import TestCase
89
import django_dynamic_fixture as fixture
910
from django.contrib.auth.models import User
1011
from mock import Mock, patch
@@ -14,7 +15,6 @@
1415
from readthedocs.config import ALL
1516
from readthedocs.projects.exceptions import RepositoryError
1617
from readthedocs.projects.models import Feature, Project
17-
from readthedocs.rtd_tests.base import RTDTestCase
1818
from readthedocs.rtd_tests.utils import (
1919
create_git_branch,
2020
create_git_tag,
@@ -25,7 +25,7 @@
2525
)
2626

2727

28-
class TestGitBackend(RTDTestCase):
28+
class TestGitBackend(TestCase):
2929
def setUp(self):
3030
git_repo = make_test_git()
3131
super().setUp()
@@ -277,7 +277,7 @@ def test_fetch_clean_tags_and_branches(self, checkout_path):
277277
)
278278

279279

280-
class TestHgBackend(RTDTestCase):
280+
class TestHgBackend(TestCase):
281281

282282
def setUp(self):
283283
hg_repo = make_test_hg()

readthedocs/rtd_tests/tests/test_backend_svn.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# -*- coding: utf-8 -*-
22
"""Tests For SVN."""
33

4+
from django.test import TestCase
5+
46
from django_dynamic_fixture import get
57

68
from readthedocs.builds.models import Version
79
from readthedocs.projects.models import Project
8-
from readthedocs.rtd_tests.base import RTDTestCase
910
from readthedocs.vcs_support.backends.svn import Backend as SvnBackend
1011

1112

12-
class TestSvnBackend(RTDTestCase):
13+
class TestSvnBackend(TestCase):
1314

1415
def test_get_url(self):
1516
project = get(Project)

readthedocs/rtd_tests/tests/test_celery.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from tempfile import mkdtemp
55

66
from allauth.socialaccount.models import SocialAccount
7+
from django.test import TestCase
78
from django.contrib.auth.models import User
89
from django_dynamic_fixture import get
910
from messages_extends.models import Message
@@ -22,7 +23,6 @@
2223
from readthedocs.projects import tasks
2324
from readthedocs.projects.exceptions import RepositoryError
2425
from readthedocs.projects.models import Project
25-
from readthedocs.rtd_tests.base import RTDTestCase
2626
from readthedocs.rtd_tests.mocks.mock_api import mock_api
2727
from readthedocs.rtd_tests.utils import (
2828
create_git_branch,
@@ -32,7 +32,7 @@
3232
)
3333

3434

35-
class TestCeleryBuilding(RTDTestCase):
35+
class TestCeleryBuilding(TestCase):
3636

3737
"""
3838
These tests run the build functions directly.

readthedocs/settings/base.py

-8
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ class CommunityBaseSettings(Settings):
8787
DONT_HIT_API = False
8888
DONT_HIT_DB = True
8989

90-
SYNC_USER = getpass.getuser()
91-
9290
USER_MATURITY_DAYS = 7
9391

9492
# override classes
@@ -144,7 +142,6 @@ def INSTALLED_APPS(self): # noqa
144142
'readthedocs.sphinx_domains',
145143
'readthedocs.search',
146144

147-
148145
# allauth
149146
'allauth',
150147
'allauth.account',
@@ -214,9 +211,6 @@ def USE_PROMOS(self): # noqa
214211
SITE_ROOT = os.path.dirname(
215212
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
216213
TEMPLATE_ROOT = os.path.join(SITE_ROOT, 'readthedocs', 'templates')
217-
DOCROOT = os.path.join(SITE_ROOT, 'user_builds')
218-
UPLOAD_ROOT = os.path.join(SITE_ROOT, 'user_uploads')
219-
CNAME_ROOT = os.path.join(SITE_ROOT, 'cnames')
220214
LOGS_ROOT = os.path.join(SITE_ROOT, 'logs')
221215
PRODUCTION_ROOT = os.path.join(SITE_ROOT, 'prod_artifacts')
222216
PRODUCTION_MEDIA_ARTIFACTS = os.path.join(PRODUCTION_ROOT, 'media')
@@ -430,7 +424,6 @@ def USE_PROMOS(self): # noqa
430424
DEFAULT_PRIVACY_LEVEL = 'public'
431425
DEFAULT_VERSION_PRIVACY_LEVEL = 'public'
432426
GROK_API_HOST = 'https://api.grokthedocs.com'
433-
SERVE_DOCS = ['public']
434427
ALLOW_ADMIN = True
435428

436429
# Elasticsearch settings.
@@ -508,7 +501,6 @@ def USE_PROMOS(self): # noqa
508501
GRAVATAR_DEFAULT_IMAGE = 'https://assets.readthedocs.org/static/images/silhouette.png' # NOQA
509502
OAUTH_AVATAR_USER_DEFAULT_URL = GRAVATAR_DEFAULT_IMAGE
510503
OAUTH_AVATAR_ORG_DEFAULT_URL = GRAVATAR_DEFAULT_IMAGE
511-
RESTRICTEDSESSIONS_AUTHED_ONLY = True
512504
RESTRUCTUREDTEXT_FILTER_SETTINGS = {
513505
'cloak_email_addresses': True,
514506
'file_insertion_enabled': False,

0 commit comments

Comments
 (0)