~netlandish/django-wiki

1297a2ad29822813d8cad5029e9291afc0ec228f — Benjamin Bach 6 years ago 3678e99 + e032a5e
Merge pull request #822 from rsalmaso/tests

Tests cleanup
M testproject/testproject/settings/base.py => testproject/testproject/settings/base.py +18 -18
@@ 28,26 28,26 @@ ALLOWED_HOSTS = []


INSTALLED_APPS = [
    'django.contrib.humanize',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'django.contrib.admindocs',
    'django.contrib.humanize.apps.HumanizeConfig',
    'django.contrib.auth.apps.AuthConfig',
    'django.contrib.contenttypes.apps.ContentTypesConfig',
    'django.contrib.sessions.apps.SessionsConfig',
    'django.contrib.sites.apps.SitesConfig',
    'django.contrib.messages.apps.MessagesConfig',
    'django.contrib.staticfiles.apps.StaticFilesConfig',
    'django.contrib.admin.apps.AdminConfig',
    'django.contrib.admindocs.apps.AdminDocsConfig',
    'sekizai',
    'sorl.thumbnail',
    'django_nyt',
    'wiki',
    'wiki.plugins.macros',
    'wiki.plugins.help',
    'wiki.plugins.links',
    'wiki.plugins.images',
    'wiki.plugins.attachments',
    'wiki.plugins.notifications',
    'wiki.plugins.globalhistory',
    "django_nyt.apps.DjangoNytConfig",
    "wiki.apps.WikiConfig",
    "wiki.plugins.macros.apps.MacrosConfig",
    'wiki.plugins.help.apps.HelpConfig',
    'wiki.plugins.links.apps.LinksConfig',
    "wiki.plugins.images.apps.ImagesConfig",
    "wiki.plugins.attachments.apps.AttachmentsConfig",
    "wiki.plugins.notifications.apps.NotificationsConfig",
    'wiki.plugins.globalhistory.apps.GlobalHistoryConfig',
    'mptt',
]


M tests/core/test_checks.py => tests/core/test_checks.py +5 -1
@@ 6,10 6,14 @@ from django.test import TestCase
from wiki.checks import OBSOLETE_INSTALLED_APPS, REQUIRED_CONTEXT_PROCESSORS, REQUIRED_INSTALLED_APPS, Tags


def _remove(settings, arg):
    return [setting for setting in settings if not setting.startswith(arg)]


class CheckTests(TestCase):
    def test_required_installed_apps(self):
        for app in REQUIRED_INSTALLED_APPS:
            with self.modify_settings(INSTALLED_APPS={'remove': [app[0]]}):
            with self.settings(INSTALLED_APPS=_remove(settings.INSTALLED_APPS, app[0])):
                errors = registry.run_checks(tags=[Tags.required_installed_apps])
                expected_errors = [
                    Error(

M tests/core/test_urls.py => tests/core/test_urls.py +0 -3
@@ 1,4 1,3 @@
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.test.testcases import TestCase
from wiki.compat import include, url


@@ 7,8 6,6 @@ from wiki.urls import WikiURLPatterns, get_pattern as get_wiki_pattern

from ..base import wiki_override_settings

User = get_user_model()


class WikiCustomUrlPatterns(WikiURLPatterns):


M tests/settings.py => tests/settings.py +7 -7
@@ 19,13 19,13 @@ SITE_ID = 1
ROOT_URLCONF = 'tests.testdata.urls'
INSTALLED_APPS = [
    'tests.testdata',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.admin',
    'django.contrib.humanize',
    'django.contrib.sites',
    'django_nyt',
    'django.contrib.auth.apps.AuthConfig',
    'django.contrib.contenttypes.apps.ContentTypesConfig',
    'django.contrib.sessions.apps.SessionsConfig',
    'django.contrib.admin.apps.AdminConfig',
    'django.contrib.humanize.apps.HumanizeConfig',
    'django.contrib.sites.apps.SitesConfig',
    'django_nyt.apps.DjangoNytConfig',
    'mptt',
    'sekizai',
    'sorl.thumbnail',

M tests/testdata/urls.py => tests/testdata/urls.py +0 -1
@@ 4,7 4,6 @@ from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from wiki.compat import include, url
from wiki.urls import get_pattern as get_wiki_pattern

admin.autodiscover()

urlpatterns = [
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),