summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-01-20 08:01:02 -0500
committerGitHub <noreply@github.com>2017-01-20 08:01:02 -0500
commit4e729feaa647547f25debb1cb63dec989dc41a20 (patch)
tree7c7a38c5961bf4daf98a8cb47dc74c769563ffcf /tests/admin_scripts
parentec4c1d6717da7a9d09d5b3ce84cccac819bb592c (diff)
Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.
These functions do nothing on Python 3.
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py11
-rw-r--r--tests/admin_scripts/urls.py3
2 files changed, 6 insertions, 8 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 50e034e03e..25e6487a0f 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -26,10 +26,9 @@ from django.db.migrations.recorder import MigrationRecorder
from django.test import (
LiveServerTestCase, SimpleTestCase, TestCase, mock, override_settings,
)
-from django.utils._os import npath, upath
from django.utils.encoding import force_text
-custom_templates_dir = os.path.join(os.path.dirname(upath(__file__)), 'custom_templates')
+custom_templates_dir = os.path.join(os.path.dirname(__file__), 'custom_templates')
PY36 = sys.version_info >= (3, 6)
SYSTEM_CHECK_MSG = 'System check identified no issues'
@@ -128,7 +127,7 @@ class AdminScriptTestCase(unittest.TestCase):
def run_test(self, script, args, settings_file=None, apps=None):
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(upath(__file__)))
+ tests_dir = os.path.dirname(os.path.dirname(__file__))
# The base dir for Django is one level above the test dir. We don't use
# `import django` to figure that out, so we don't pick up a Django
# from site-packages or similar.
@@ -152,7 +151,7 @@ class AdminScriptTestCase(unittest.TestCase):
python_path = [base_dir, django_dir, tests_dir]
python_path.extend(ext_backend_base_dirs)
# Use native strings for better compatibility
- test_environ[str(python_path_var_name)] = npath(os.pathsep.join(python_path))
+ test_environ[str(python_path_var_name)] = os.pathsep.join(python_path)
test_environ[str('PYTHONWARNINGS')] = str('')
# Move to the test directory and run
@@ -168,7 +167,7 @@ class AdminScriptTestCase(unittest.TestCase):
return out, err
def run_django_admin(self, args, settings_file=None):
- script_dir = os.path.abspath(os.path.join(os.path.dirname(upath(django.__file__)), 'bin'))
+ script_dir = os.path.abspath(os.path.join(os.path.dirname(django.__file__), 'bin'))
return self.run_test(os.path.join(script_dir, 'django-admin.py'), args, settings_file)
def run_manage(self, args, settings_file=None):
@@ -178,7 +177,7 @@ class AdminScriptTestCase(unittest.TestCase):
except OSError:
pass
- conf_dir = os.path.dirname(upath(conf.__file__))
+ conf_dir = os.path.dirname(conf.__file__)
template_manage_py = os.path.join(conf_dir, 'project_template', 'manage.py-tpl')
test_manage_py = os.path.join(self.test_dir, 'manage.py')
diff --git a/tests/admin_scripts/urls.py b/tests/admin_scripts/urls.py
index d258641fbe..edb5e1f3b0 100644
--- a/tests/admin_scripts/urls.py
+++ b/tests/admin_scripts/urls.py
@@ -1,10 +1,9 @@
import os
from django.conf.urls import url
-from django.utils._os import upath
from django.views.static import serve
-here = os.path.dirname(upath(__file__))
+here = os.path.dirname(__file__)
urlpatterns = [
url(r'^custom_templates/(?P<path>.*)$', serve, {