diff options
Diffstat (limited to 'tests/model_forms')
| -rw-r--r-- | tests/model_forms/models.py | 3 | ||||
| -rw-r--r-- | tests/model_forms/tests.py | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/tests/model_forms/models.py b/tests/model_forms/models.py index f85ae8e1fd..c1c97270fc 100644 --- a/tests/model_forms/models.py +++ b/tests/model_forms/models.py @@ -15,7 +15,6 @@ from django.core import validators from django.core.exceptions import ValidationError from django.core.files.storage import FileSystemStorage from django.db import models -from django.utils._os import upath temp_storage_dir = tempfile.mkdtemp() temp_storage = FileSystemStorage(temp_storage_dir) @@ -160,7 +159,7 @@ class CustomFF(models.Model): class FilePathModel(models.Model): - path = models.FilePathField(path=os.path.dirname(upath(__file__)), match=r".*\.py$", blank=True) + path = models.FilePathField(path=os.path.dirname(__file__), match=r".*\.py$", blank=True) try: diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py index 108c917587..3c8f7ed108 100644 --- a/tests/model_forms/tests.py +++ b/tests/model_forms/tests.py @@ -17,7 +17,6 @@ from django.forms.models import ( ) from django.template import Context, Template from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature -from django.utils._os import upath from .models import ( Article, ArticleStatus, Author, Author1, Award, BetterWriter, BigInt, Book, @@ -2221,7 +2220,7 @@ class FileAndImageFieldTests(TestCase): fields = '__all__' # Grab an image for testing. - filename = os.path.join(os.path.dirname(upath(__file__)), "test.png") + filename = os.path.join(os.path.dirname(__file__), 'test.png') with open(filename, "rb") as fp: img = fp.read() @@ -2260,9 +2259,9 @@ class FileAndImageFieldTests(TestCase): # it comes to validation. This specifically tests that #6302 is fixed for # both file fields and image fields. - with open(os.path.join(os.path.dirname(upath(__file__)), "test.png"), 'rb') as fp: + with open(os.path.join(os.path.dirname(__file__), 'test.png'), 'rb') as fp: image_data = fp.read() - with open(os.path.join(os.path.dirname(upath(__file__)), "test2.png"), 'rb') as fp: + with open(os.path.join(os.path.dirname(__file__), 'test2.png'), 'rb') as fp: image_data2 = fp.read() f = ImageFileForm( |
