From 193c109327c5216cab1d4eed6bfdff24629b09a3 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 26 Nov 2018 14:05:02 -0500 Subject: Switched TestCase to SimpleTestCase where possible in Django's tests. --- tests/admin_docs/test_utils.py | 4 ++-- tests/admin_docs/tests.py | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'tests/admin_docs') diff --git a/tests/admin_docs/test_utils.py b/tests/admin_docs/test_utils.py index 0c738e5e89..17ea912015 100644 --- a/tests/admin_docs/test_utils.py +++ b/tests/admin_docs/test_utils.py @@ -4,11 +4,11 @@ from django.contrib.admindocs.utils import ( docutils_is_available, parse_docstring, parse_rst, trim_docstring, ) -from .tests import AdminDocsTestCase +from .tests import AdminDocsSimpleTestCase @unittest.skipUnless(docutils_is_available, "no docutils installed.") -class TestUtils(AdminDocsTestCase): +class TestUtils(AdminDocsSimpleTestCase): """ This __doc__ output is required for testing. I copied this example from `admindocs` documentation. (TITLE) diff --git a/tests/admin_docs/tests.py b/tests/admin_docs/tests.py index dfe6104a33..d53cb80c94 100644 --- a/tests/admin_docs/tests.py +++ b/tests/admin_docs/tests.py @@ -1,5 +1,7 @@ from django.contrib.auth.models import User -from django.test import TestCase, modify_settings, override_settings +from django.test import ( + SimpleTestCase, TestCase, modify_settings, override_settings, +) class TestDataMixin: @@ -9,6 +11,12 @@ class TestDataMixin: cls.superuser = User.objects.create_superuser(username='super', password='secret', email='super@example.com') +@override_settings(ROOT_URLCONF='admin_docs.urls') +@modify_settings(INSTALLED_APPS={'append': 'django.contrib.admindocs'}) +class AdminDocsSimpleTestCase(SimpleTestCase): + pass + + @override_settings(ROOT_URLCONF='admin_docs.urls') @modify_settings(INSTALLED_APPS={'append': 'django.contrib.admindocs'}) class AdminDocsTestCase(TestCase): -- cgit v1.3