summaryrefslogtreecommitdiff
path: root/tests/regressiontests/file_storage/tests.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-12-08 11:13:52 +0100
committerClaude Paroz <claude@2xlibre.net>2012-12-08 11:13:52 +0100
commitc91667338a4e774e2819ccf4da852dc7b759bc19 (patch)
tree42a700d237c85ac2b647999d02d3dcd7d8047068 /tests/regressiontests/file_storage/tests.py
parent53b879f045f0e55cc8f4bedff67b5a14f3057561 (diff)
Fixed #19357 -- Allow non-ASCII chars in filesystem paths
Thanks kujiu for the report and Aymeric Augustin for the review.
Diffstat (limited to 'tests/regressiontests/file_storage/tests.py')
-rw-r--r--tests/regressiontests/file_storage/tests.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/regressiontests/file_storage/tests.py b/tests/regressiontests/file_storage/tests.py
index 45c18ba14a..b6d3e1ff0b 100644
--- a/tests/regressiontests/file_storage/tests.py
+++ b/tests/regressiontests/file_storage/tests.py
@@ -24,6 +24,7 @@ from django.core.files.uploadedfile import UploadedFile
from django.test import SimpleTestCase
from django.utils import six
from django.utils import unittest
+from django.utils._os import upath
from django.test.utils import override_settings
from ..servers.tests import LiveServerBase
@@ -104,7 +105,7 @@ class FileStorageTests(unittest.TestCase):
"""
storage = self.storage_class(location='')
self.assertEqual(storage.base_location, '')
- self.assertEqual(storage.location, os.getcwd())
+ self.assertEqual(storage.location, upath(os.getcwd()))
def test_file_access_options(self):
"""
@@ -534,7 +535,7 @@ class DimensionClosingBug(unittest.TestCase):
from django.core.files import images
images.open = catching_open
try:
- get_image_dimensions(os.path.join(os.path.dirname(__file__), "test1.png"))
+ get_image_dimensions(os.path.join(os.path.dirname(upath(__file__)), "test1.png"))
finally:
del images.open
self.assertTrue(FileWrapper._closed)
@@ -551,7 +552,7 @@ class InconsistentGetImageDimensionsBug(unittest.TestCase):
"""
from django.core.files.images import ImageFile
- img_path = os.path.join(os.path.dirname(__file__), "test.png")
+ img_path = os.path.join(os.path.dirname(upath(__file__)), "test.png")
image = ImageFile(open(img_path, 'rb'))
image_pil = Image.open(img_path)
size_1, size_2 = get_image_dimensions(image), get_image_dimensions(image)