summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-09 20:31:27 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-14 17:50:04 +0100
commit90c59b4e12e6ff41407694a460f5f30c4688dbfd (patch)
tree7bf06c10582702d59253e5ac26b7d603b7bce594 /tests/admin_scripts
parent68e3ca13d771a8f08a8d1c272308cd44b4dcfa76 (diff)
downloaddjango-90c59b4e12e6ff41407694a460f5f30c4688dbfd.tar.gz
Refs #23433 -- Removed django-admin.py entry point per deprecation timeline.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/test_django_admin_py.py39
-rw-r--r--tests/admin_scripts/tests.py23
2 files changed, 14 insertions, 48 deletions
diff --git a/tests/admin_scripts/test_django_admin_py.py b/tests/admin_scripts/test_django_admin_py.py
deleted file mode 100644
index b8b42fb75a..0000000000
--- a/tests/admin_scripts/test_django_admin_py.py
+++ /dev/null
@@ -1,39 +0,0 @@
-import os
-import subprocess
-import sys
-
-import django
-from django.test import SimpleTestCase
-
-
-class DeprecationTests(SimpleTestCase):
- DEPRECATION_MESSAGE = (
- b'RemovedInDjango40Warning: django-admin.py is deprecated in favor of '
- b'django-admin.'
- )
-
- def setUp(self):
- script_dir = os.path.abspath(os.path.join(os.path.dirname(django.__file__), 'bin'))
- self.django_admin_py = os.path.join(script_dir, 'django-admin.py')
-
- def _run_test(self, args):
- p = subprocess.run(
- [sys.executable, *args],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- check=True,
- )
- return p.stdout, p.stderr
-
- def test_django_admin_py_deprecated(self):
- _, err = self._run_test(['-Wd', self.django_admin_py, '--version'])
- self.assertIn(self.DEPRECATION_MESSAGE, err)
-
- def test_main_not_deprecated(self):
- _, err = self._run_test(['-Wd', '-m', 'django', '--version'])
- self.assertNotIn(self.DEPRECATION_MESSAGE, err)
-
- def test_django_admin_py_equivalent_main(self):
- django_admin_py_out, _ = self._run_test([self.django_admin_py, '--version'])
- django_out, _ = self._run_test(['-m', 'django', '--version'])
- self.assertEqual(django_admin_py_out, django_out)
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 7a38306d17..d9ec07a3e3 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -167,12 +167,12 @@ class AdminScriptTestCase(SimpleTestCase):
##########################################################################
# DJANGO ADMIN TESTS
# This first series of test classes checks the environment processing
-# of the django-admin.py script
+# of the django-admin.
##########################################################################
class DjangoAdminNoSettings(AdminScriptTestCase):
- "A series of tests for django-admin.py when there is no settings.py file."
+ "A series of tests for django-admin when there is no settings.py file."
def test_builtin_command(self):
"no settings: django-admin builtin commands fail with an error when no settings provided"
@@ -207,7 +207,8 @@ class DjangoAdminNoSettings(AdminScriptTestCase):
class DjangoAdminDefaultSettings(AdminScriptTestCase):
- """A series of tests for django-admin.py when using a settings.py file that
+ """
+ A series of tests for django-admin when using a settings.py file that
contains the test application.
"""
def setUp(self):
@@ -273,7 +274,8 @@ class DjangoAdminDefaultSettings(AdminScriptTestCase):
class DjangoAdminFullPathDefaultSettings(AdminScriptTestCase):
- """A series of tests for django-admin.py when using a settings.py file that
+ """
+ A series of tests for django-admin when using a settings.py file that
contains the test application specified using a full path.
"""
def setUp(self):
@@ -340,7 +342,8 @@ class DjangoAdminFullPathDefaultSettings(AdminScriptTestCase):
class DjangoAdminMinimalSettings(AdminScriptTestCase):
- """A series of tests for django-admin.py when using a settings.py file that
+ """
+ A series of tests for django-admin when using a settings.py file that
doesn't contain the test application.
"""
def setUp(self):
@@ -406,8 +409,9 @@ class DjangoAdminMinimalSettings(AdminScriptTestCase):
class DjangoAdminAlternateSettings(AdminScriptTestCase):
- """A series of tests for django-admin.py when using a settings file
- with a name other than 'settings.py'.
+ """
+ A series of tests for django-admin when using a settings file with a name
+ other than 'settings.py'.
"""
def setUp(self):
super().setUp()
@@ -472,7 +476,8 @@ class DjangoAdminAlternateSettings(AdminScriptTestCase):
class DjangoAdminMultipleSettings(AdminScriptTestCase):
- """A series of tests for django-admin.py when multiple settings files
+ """
+ A series of tests for django-admin when multiple settings files
(including the default 'settings.py') are available. The default settings
file is insufficient for performing the operations described, so the
alternate settings must be used by the running script.
@@ -541,7 +546,7 @@ class DjangoAdminMultipleSettings(AdminScriptTestCase):
class DjangoAdminSettingsDirectory(AdminScriptTestCase):
"""
- A series of tests for django-admin.py when the settings file is in a
+ A series of tests for django-admin when the settings file is in a
directory. (see #9751).
"""