summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2014-11-21 19:26:46 +0500
committerTim Graham <timograham@gmail.com>2014-11-24 15:55:43 -0500
commit78fe7ec14ff14130a99edb30584b0ffc49c8ec8c (patch)
treec380908bb013edc18802984481e9e3d8f0785b1f /tests
parent014f699c8bc77da972990b767ab7a5582a8844e9 (diff)
[1.7.x] Fixed #23888 -- Fixed crash in File.__repr__() when name contains unicode.
Backport of 1e9ac504e4 from master
Diffstat (limited to 'tests')
-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 b9f8b5228a..629659a01d 100644
--- a/tests/files/tests.py
+++ b/tests/files/tests.py
@@ -26,13 +26,12 @@ except ImproperlyConfigured:
class FileTests(unittest.TestCase):
def test_unicode_uploadedfile_name(self):
- """
- Regression test for #8156: files with unicode names I can't quite figure
- out the encoding situation between doctest and this file, but the actual
- repr doesn't matter; it just shouldn't return a unicode object.
- """
uf = UploadedFile(name='¿Cómo?', content_type='text')
- self.assertEqual(type(uf.__repr__()), str)
+ self.assertIs(type(repr(uf)), str)
+
+ def test_unicode_file_name(self):
+ f = File(None, 'djángö')
+ self.assertIs(type(repr(f)), str)
def test_context_manager(self):
orig_file = tempfile.TemporaryFile()