~ubuntu-branches/ubuntu/oneiric/python-django/oneiric-201108291626

« back to all changes in this revision

Viewing changes to tests/regressiontests/file_storage/tests.py

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-10-12 11:34:35 UTC
  • mfrom: (1.1.12 upstream) (29.1.1 maverick-security)
  • Revision ID: james.westby@ubuntu.com-20101012113435-yy57c8tx6g9anf3e
Tags: 1.2.3-1ubuntu0.1
* SECURITY UPDATE: XSS in CSRF protections. New upstream release
  - CVE-2010-3082
* debian/patches/01_disable_url_verify_regression_tests.diff:
  - updated to disable another test that fails without internet connection
  - patch based on work by Kai Kasurinen and Krzysztof Klimonda
* debian/control: don't Build-Depends on locales-all, which doesn't exist
  in maverick

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
            finally:
231
231
                del images.open
232
232
            self.assert_(FileWrapper._closed)
 
233
 
 
234
    class InconsistentGetImageDimensionsBug(TestCase):
 
235
        """
 
236
        Test that get_image_dimensions() works properly after various calls using a file handler (#11158)
 
237
        """
 
238
        def test_multiple_calls(self):
 
239
            """
 
240
            Multiple calls of get_image_dimensions() should return the same size.
 
241
            """
 
242
            from django.core.files.images import ImageFile
 
243
            img_path = os.path.join(os.path.dirname(__file__), "test.png")
 
244
            image = ImageFile(open(img_path))
 
245
            image_pil = Image.open(img_path)
 
246
            size_1, size_2 = get_image_dimensions(image), get_image_dimensions(image)
 
247
            self.assertEqual(image_pil.size, size_1)
 
248
            self.assertEqual(size_1, size_2)