Skip to content

Commit

Permalink
Remove more settings, command and test class
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos committed Jan 18, 2020
1 parent 9518912 commit dc5448b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 73 deletions.
39 changes: 0 additions & 39 deletions readthedocs/core/management/commands/archive.py

This file was deleted.

19 changes: 0 additions & 19 deletions readthedocs/rtd_tests/base.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# -*- coding: utf-8 -*-
"""Base classes and mixins for unit tests."""
import logging
import os
import shutil
import tempfile
from collections import OrderedDict

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


class RTDTestCase(TestCase):
def setUp(self):
self.original_DOCROOT = settings.DOCROOT
self.cwd = os.path.dirname(__file__)
self.build_dir = tempfile.mkdtemp()
log.info('build dir: %s', self.build_dir)
if not os.path.exists(self.build_dir):
os.makedirs(self.build_dir)
settings.DOCROOT = self.build_dir

def tearDown(self):
shutil.rmtree(self.build_dir)
settings.DOCROOT = self.original_DOCROOT


@patch('readthedocs.projects.views.private.trigger_build', lambda x: None)
@patch('readthedocs.projects.views.private.trigger_build', lambda x: None)
class MockBuildTestCase(TestCase):
Expand Down
6 changes: 3 additions & 3 deletions readthedocs/rtd_tests/tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from tempfile import mkdtemp
import textwrap

from django.test import TestCase
import django_dynamic_fixture as fixture
from django.contrib.auth.models import User
from mock import Mock, patch
Expand All @@ -14,7 +15,6 @@
from readthedocs.config import ALL
from readthedocs.projects.exceptions import RepositoryError
from readthedocs.projects.models import Feature, Project
from readthedocs.rtd_tests.base import RTDTestCase
from readthedocs.rtd_tests.utils import (
create_git_branch,
create_git_tag,
Expand All @@ -25,7 +25,7 @@
)


class TestGitBackend(RTDTestCase):
class TestGitBackend(TestCase):
def setUp(self):
git_repo = make_test_git()
super().setUp()
Expand Down Expand Up @@ -277,7 +277,7 @@ def test_fetch_clean_tags_and_branches(self, checkout_path):
)


class TestHgBackend(RTDTestCase):
class TestHgBackend(TestCase):

def setUp(self):
hg_repo = make_test_hg()
Expand Down
5 changes: 3 additions & 2 deletions readthedocs/rtd_tests/tests/test_backend_svn.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# -*- coding: utf-8 -*-
"""Tests For SVN."""

from django.test import TestCase

from django_dynamic_fixture import get

from readthedocs.builds.models import Version
from readthedocs.projects.models import Project
from readthedocs.rtd_tests.base import RTDTestCase
from readthedocs.vcs_support.backends.svn import Backend as SvnBackend


class TestSvnBackend(RTDTestCase):
class TestSvnBackend(TestCase):

def test_get_url(self):
project = get(Project)
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/rtd_tests/tests/test_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from tempfile import mkdtemp

from allauth.socialaccount.models import SocialAccount
from django.test import TestCase
from django.contrib.auth.models import User
from django_dynamic_fixture import get
from messages_extends.models import Message
Expand All @@ -22,7 +23,6 @@
from readthedocs.projects import tasks
from readthedocs.projects.exceptions import RepositoryError
from readthedocs.projects.models import Project
from readthedocs.rtd_tests.base import RTDTestCase
from readthedocs.rtd_tests.mocks.mock_api import mock_api
from readthedocs.rtd_tests.utils import (
create_git_branch,
Expand All @@ -32,7 +32,7 @@
)


class TestCeleryBuilding(RTDTestCase):
class TestCeleryBuilding(TestCase):

"""
These tests run the build functions directly.
Expand Down
8 changes: 0 additions & 8 deletions readthedocs/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ class CommunityBaseSettings(Settings):
DONT_HIT_API = False
DONT_HIT_DB = True

SYNC_USER = getpass.getuser()

USER_MATURITY_DAYS = 7

# override classes
Expand Down Expand Up @@ -144,7 +142,6 @@ def INSTALLED_APPS(self): # noqa
'readthedocs.sphinx_domains',
'readthedocs.search',


# allauth
'allauth',
'allauth.account',
Expand Down Expand Up @@ -214,9 +211,6 @@ def USE_PROMOS(self): # noqa
SITE_ROOT = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
TEMPLATE_ROOT = os.path.join(SITE_ROOT, 'readthedocs', 'templates')
DOCROOT = os.path.join(SITE_ROOT, 'user_builds')
UPLOAD_ROOT = os.path.join(SITE_ROOT, 'user_uploads')
CNAME_ROOT = os.path.join(SITE_ROOT, 'cnames')
LOGS_ROOT = os.path.join(SITE_ROOT, 'logs')
PRODUCTION_ROOT = os.path.join(SITE_ROOT, 'prod_artifacts')
PRODUCTION_MEDIA_ARTIFACTS = os.path.join(PRODUCTION_ROOT, 'media')
Expand Down Expand Up @@ -430,7 +424,6 @@ def USE_PROMOS(self): # noqa
DEFAULT_PRIVACY_LEVEL = 'public'
DEFAULT_VERSION_PRIVACY_LEVEL = 'public'
GROK_API_HOST = 'https://api.grokthedocs.com'
SERVE_DOCS = ['public']
ALLOW_ADMIN = True

# Elasticsearch settings.
Expand Down Expand Up @@ -508,7 +501,6 @@ def USE_PROMOS(self): # noqa
GRAVATAR_DEFAULT_IMAGE = 'https://assets.readthedocs.org/static/images/silhouette.png' # NOQA
OAUTH_AVATAR_USER_DEFAULT_URL = GRAVATAR_DEFAULT_IMAGE
OAUTH_AVATAR_ORG_DEFAULT_URL = GRAVATAR_DEFAULT_IMAGE
RESTRICTEDSESSIONS_AUTHED_ONLY = True
RESTRUCTUREDTEXT_FILTER_SETTINGS = {
'cloak_email_addresses': True,
'file_insertion_enabled': False,
Expand Down

0 comments on commit dc5448b

Please sign in to comment.