summaryrefslogtreecommitdiff
path: root/tests/regressiontests/file_storage/tests.py
diff options
context:
space:
mode:
authorArthur Koziel <arthur@arthurkoziel.com>2010-09-13 00:04:27 +0000
committerArthur Koziel <arthur@arthurkoziel.com>2010-09-13 00:04:27 +0000
commitdd49269c7db008b2567f50cb03c4d3d9b321daa1 (patch)
tree326dd25bb045ac016cda7966b43cbdfe1f67d699 /tests/regressiontests/file_storage/tests.py
parentc9b188c4ec939abbe48dae5a371276742e64b6b8 (diff)
downloaddjango-soc2010/app-loading.tar.gz
[soc2010/app-loading] merged trunkarchive/soc2010/app-loadingsoc2010/app-loading
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/app-loading@13818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/file_storage/tests.py')
-rw-r--r--tests/regressiontests/file_storage/tests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/regressiontests/file_storage/tests.py b/tests/regressiontests/file_storage/tests.py
index 2c5f0f4551..a1470f9f05 100644
--- a/tests/regressiontests/file_storage/tests.py
+++ b/tests/regressiontests/file_storage/tests.py
@@ -230,3 +230,19 @@ if Image is not None:
finally:
del images.open
self.assert_(FileWrapper._closed)
+
+ class InconsistentGetImageDimensionsBug(TestCase):
+ """
+ Test that get_image_dimensions() works properly after various calls using a file handler (#11158)
+ """
+ def test_multiple_calls(self):
+ """
+ Multiple calls of get_image_dimensions() should return the same size.
+ """
+ from django.core.files.images import ImageFile
+ img_path = os.path.join(os.path.dirname(__file__), "test.png")
+ image = ImageFile(open(img_path))
+ image_pil = Image.open(img_path)
+ 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)