commit 3d713c4a32b5938651534ff4832c5afe776f14f4
Author: Honza Kral <Honza.Kral@gmail.com>
Date: Thu May 7 12:36:37 2009 +0200
Fixed some failing tests for files with encoding
diff --git a/django/core/files/storage.py b/django/core/files/storage.py
index bf30a78..13acada 100644
a
|
b
|
from django.conf import settings
|
6 | 6 | from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation |
7 | 7 | from django.core.files import locks, File |
8 | 8 | from django.core.files.move import file_move_safe |
9 | | from django.utils.encoding import force_unicode |
| 9 | from django.utils.encoding import force_unicode, smart_str |
10 | 10 | from django.utils.functional import LazyObject |
11 | 11 | from django.utils.importlib import import_module |
12 | 12 | from django.utils.text import get_valid_filename |
… |
… |
class FileSystemStorage(Storage):
|
212 | 212 | path = safe_join(self.location, name) |
213 | 213 | except ValueError: |
214 | 214 | raise SuspiciousOperation("Attempted access to '%s' denied." % name) |
215 | | return os.path.normpath(path) |
| 215 | return smart_str(os.path.normpath(path)) |
216 | 216 | |
217 | 217 | def size(self, name): |
218 | 218 | return os.path.getsize(self.path(name)) |
diff --git a/tests/modeltests/files/models.py b/tests/modeltests/files/models.py
index ba3eb99..30bbdf2 100644
a
|
b
|
ValueError: The 'normal' attribute has no file associated with it.
|
70 | 70 | [] |
71 | 71 | >>> files.sort() |
72 | 72 | >>> files |
73 | | [u'default.txt', u'django_test.txt'] |
| 73 | ['default.txt', 'django_test.txt'] |
74 | 74 | |
75 | 75 | >>> obj1.save() |
76 | 76 | >>> dirs, files = temp_storage.listdir('tests') |
77 | 77 | >>> files.sort() |
78 | 78 | >>> files |
79 | | [u'assignment.txt', u'default.txt', u'django_test.txt'] |
| 79 | ['assignment.txt', 'default.txt', 'django_test.txt'] |
80 | 80 | |
81 | 81 | # Files can be read in a little at a time, if necessary. |
82 | 82 | |