From c91667338a4e774e2819ccf4da852dc7b759bc19 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 8 Dec 2012 11:13:52 +0100 Subject: Fixed #19357 -- Allow non-ASCII chars in filesystem paths Thanks kujiu for the report and Aymeric Augustin for the review. --- tests/modeltests/model_forms/tests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/modeltests/model_forms') diff --git a/tests/modeltests/model_forms/tests.py b/tests/modeltests/model_forms/tests.py index c47de45ef7..c008c00906 100644 --- a/tests/modeltests/model_forms/tests.py +++ b/tests/modeltests/model_forms/tests.py @@ -10,6 +10,7 @@ from django.core.validators import ValidationError from django.db import connection from django.db.models.query import EmptyQuerySet from django.forms.models import model_to_dict +from django.utils._os import upath from django.utils.unittest import skipUnless from django.test import TestCase from django.utils import six @@ -1282,9 +1283,9 @@ class OldFormForXTests(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(__file__), "test.png"), 'rb') as fp: + with open(os.path.join(os.path.dirname(upath(__file__)), "test.png"), 'rb') as fp: image_data = fp.read() - with open(os.path.join(os.path.dirname(__file__), "test2.png"), 'rb') as fp: + with open(os.path.join(os.path.dirname(upath(__file__)), "test2.png"), 'rb') as fp: image_data2 = fp.read() f = ImageFileForm( -- cgit v1.3