summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-18 09:46:01 +0100
committerGitHub <noreply@github.com>2023-01-18 09:46:01 +0100
commit3bbe22dafcc69c5ffa79707f5a74eb1faf466e12 (patch)
tree4bec6a7016732be33f2e1cddd80c18478cb2dee9 /tests/admin_scripts
parentd54717118360e8679aa2bd0c5a1625f3e84712ba (diff)
downloaddjango-3bbe22dafcc69c5ffa79707f5a74eb1faf466e12.tar.gz
Fixed #34233 -- Dropped support for Python 3.8 and 3.9.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 4149a31e21..51d0498ff7 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -32,7 +32,6 @@ from django.db.migrations.recorder import MigrationRecorder
from django.test import LiveServerTestCase, SimpleTestCase, TestCase, override_settings
from django.test.utils import captured_stderr, captured_stdout
from django.urls import path
-from django.utils.version import PY39
from django.views.static import serve
from . import urls
@@ -107,7 +106,7 @@ class AdminScriptTestCase(SimpleTestCase):
paths.append(os.path.dirname(backend_dir))
return paths
- def run_test(self, args, settings_file=None, apps=None, umask=None):
+ def run_test(self, args, settings_file=None, apps=None, umask=-1):
base_dir = os.path.dirname(self.test_dir)
# The base dir for Django's tests is one level up.
tests_dir = os.path.dirname(os.path.dirname(__file__))
@@ -136,12 +135,11 @@ class AdminScriptTestCase(SimpleTestCase):
cwd=self.test_dir,
env=test_environ,
text=True,
- # subprocess.run()'s umask was added in Python 3.9.
- **({"umask": umask} if umask and PY39 else {}),
+ umask=umask,
)
return p.stdout, p.stderr
- def run_django_admin(self, args, settings_file=None, umask=None):
+ def run_django_admin(self, args, settings_file=None, umask=-1):
return self.run_test(["-m", "django", *args], settings_file, umask=umask)
def run_manage(self, args, settings_file=None, manage_py=None):
@@ -2812,7 +2810,6 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
sys.platform == "win32",
"Windows only partially supports umasks and chmod.",
)
- @unittest.skipUnless(PY39, "subprocess.run()'s umask was added in Python 3.9.")
def test_honor_umask(self):
_, err = self.run_django_admin(["startproject", "testproject"], umask=0o077)
self.assertNoOutput(err)