1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.

These functions do nothing on Python 3.
This commit is contained in:
Tim Graham
2017-01-20 08:01:02 -05:00
committed by GitHub
parent ec4c1d6717
commit 4e729feaa6
64 changed files with 108 additions and 178 deletions

View File

@@ -3,13 +3,12 @@ import os
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase, override_settings
from django.utils import translation
from django.utils._os import upath
@override_settings(
USE_I18N=True,
LOCALE_PATHS=[
os.path.join(os.path.dirname(upath(__file__)), 'locale'),
os.path.join(os.path.dirname(__file__), 'locale'),
],
LANGUAGE_CODE='en',
LANGUAGES=[

View File

@@ -10,7 +10,6 @@ from django.test.client import RequestFactory
from django.test.utils import override_script_prefix
from django.urls import clear_url_caches, reverse, translate_url
from django.utils import translation
from django.utils._os import upath
class PermanentRedirectLocaleMiddleWare(LocaleMiddleware):
@@ -20,7 +19,7 @@ class PermanentRedirectLocaleMiddleWare(LocaleMiddleware):
@override_settings(
USE_I18N=True,
LOCALE_PATHS=[
os.path.join(os.path.dirname(upath(__file__)), 'locale'),
os.path.join(os.path.dirname(__file__), 'locale'),
],
LANGUAGE_CODE='en-us',
LANGUAGES=[
@@ -35,7 +34,7 @@ class PermanentRedirectLocaleMiddleWare(LocaleMiddleware):
ROOT_URLCONF='i18n.patterns.urls.default',
TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(os.path.dirname(upath(__file__)), 'templates')],
'DIRS': [os.path.join(os.path.dirname(__file__), 'templates')],
'OPTIONS': {
'context_processors': [
'django.template.context_processors.i18n',

View File

@@ -2,13 +2,12 @@ import os
from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from django.utils._os import upath
from django.utils.encoding import force_text
from django.utils.translation import activate, get_language, trans_real
from .utils import POFileAssertionMixin
SAMPLEPROJECT_DIR = os.path.join(os.path.dirname(os.path.abspath(upath(__file__))), 'sampleproject')
SAMPLEPROJECT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'sampleproject')
SAMPLEPROJECT_LOCALE = os.path.join(SAMPLEPROJECT_DIR, 'locale')

View File

@@ -15,7 +15,6 @@ from django.test import (
RequestFactory, SimpleTestCase, TestCase, override_settings,
)
from django.utils import translation
from django.utils._os import upath
from django.utils.formats import (
date_format, get_format, get_format_modules, iter_format_modules, localize,
localize_input, reset_format_cache, sanitize_separators, time_format,
@@ -32,7 +31,7 @@ from django.utils.translation import (
from .forms import CompanyForm, I18nForm, SelectDateForm
from .models import Company, TestModel
here = os.path.dirname(os.path.abspath(upath(__file__)))
here = os.path.dirname(os.path.abspath(__file__))
extended_locale_paths = settings.LOCALE_PATHS + [
os.path.join(here, 'other', 'locale'),
]

View File

@@ -3,9 +3,7 @@ import re
import shutil
import tempfile
from django.utils._os import upath
source_code_dir = os.path.dirname(upath(__file__))
source_code_dir = os.path.dirname(__file__)
def copytree(src, dst):