summaryrefslogtreecommitdiff
path: root/tests/files
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/files
parentec4c1d6717da7a9d09d5b3ce84cccac819bb592c (diff)
downloaddjango-4e729feaa647547f25debb1cb63dec989dc41a20.tar.gz
Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.
These functions do nothing on Python 3.
Diffstat (limited to 'tests/files')
-rw-r--r--tests/files/tests.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/files/tests.py b/tests/files/tests.py
index 4515b1cab1..7323b6987e 100644
--- a/tests/files/tests.py
+++ b/tests/files/tests.py
@@ -11,7 +11,6 @@ from django.core.files.move import file_move_safe
from django.core.files.temp import NamedTemporaryFile
from django.core.files.uploadedfile import SimpleUploadedFile, UploadedFile
from django.test import mock
-from django.utils._os import upath
try:
from PIL import Image
@@ -227,7 +226,7 @@ class DimensionClosingBug(unittest.TestCase):
images.open = catching_open
try:
- images.get_image_dimensions(os.path.join(os.path.dirname(upath(__file__)), "test1.png"))
+ images.get_image_dimensions(os.path.join(os.path.dirname(__file__), "test1.png"))
finally:
del images.open
self.assertTrue(FileWrapper._closed)
@@ -243,7 +242,7 @@ class InconsistentGetImageDimensionsBug(unittest.TestCase):
"""
Multiple calls of get_image_dimensions() should return the same size.
"""
- img_path = os.path.join(os.path.dirname(upath(__file__)), "test.png")
+ img_path = os.path.join(os.path.dirname(__file__), "test.png")
with open(img_path, 'rb') as fh:
image = images.ImageFile(fh)
image_pil = Image.open(fh)
@@ -258,7 +257,7 @@ class InconsistentGetImageDimensionsBug(unittest.TestCase):
Regression test for #19457
get_image_dimensions fails on some pngs, while Image.size is working good on them
"""
- img_path = os.path.join(os.path.dirname(upath(__file__)), "magic.png")
+ img_path = os.path.join(os.path.dirname(__file__), "magic.png")
size = images.get_image_dimensions(img_path)
with open(img_path, 'rb') as fh:
self.assertEqual(size, Image.open(fh).size)
@@ -275,7 +274,7 @@ class GetImageDimensionsTests(unittest.TestCase):
brokenimg.png is not a valid image and it has been generated by:
$ echo "123" > brokenimg.png
"""
- img_path = os.path.join(os.path.dirname(upath(__file__)), "brokenimg.png")
+ img_path = os.path.join(os.path.dirname(__file__), "brokenimg.png")
with open(img_path, 'rb') as fh:
size = images.get_image_dimensions(fh)
self.assertEqual(size, (None, None))
@@ -288,7 +287,7 @@ class GetImageDimensionsTests(unittest.TestCase):
Emulates the Parser feed error. Since the error is raised on every feed
attempt, the resulting image size should be invalid: (None, None).
"""
- img_path = os.path.join(os.path.dirname(upath(__file__)), "test.png")
+ img_path = os.path.join(os.path.dirname(__file__), "test.png")
with mock.patch('PIL.ImageFile.Parser.feed', side_effect=struct.error):
with open(img_path, 'rb') as fh:
size = images.get_image_dimensions(fh)