mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #16590 -- Accepted a 'name' argument in the constructor of ContentFile, for consistency with File.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -542,3 +542,14 @@ class InconsistentGetImageDimensionsBug(unittest.TestCase):
|
||||
size_1, size_2 = get_image_dimensions(image), get_image_dimensions(image)
|
||||
self.assertEqual(image_pil.size, size_1)
|
||||
self.assertEqual(size_1, size_2)
|
||||
|
||||
class ContentFileTestCase(unittest.TestCase):
|
||||
"""
|
||||
Test that the constructor of ContentFile accepts 'name' (#16590).
|
||||
"""
|
||||
def test_content_file_default_name(self):
|
||||
self.assertEqual(ContentFile("content").name, None)
|
||||
|
||||
def test_content_file_custome_name(self):
|
||||
name = "I can have a name too!"
|
||||
self.assertEqual(ContentFile("content", name=name).name, name)
|
||||
|
||||
Reference in New Issue
Block a user