  from django.test import SimpleTestCase
  from django.utils import unittest
  
  # Try to import PIL in either of the two ways it can end up installed.
  # Checking for the existence of Image is enough for CPython, but
  # for PyPy, you need to check for the underlying modules
 
</s> remove from django.core.files.base import ContentFile
 </s> add from django.core.files.base import File, ContentFile </s> remove         while counter > 0:
            yield self.read(chunk_size)
            counter -= chunk_size
 </s> add         while True:
            data = self.read(chunk_size)
            if not data:
                break
            yield data </s> remove             elif os.path.exists(self.file.name):
 </s> add             elif hasattr(self.file, 'name') and os.path.exists(self.file.name):
from ..servers.tests import LiveServerBase
  from django.test import SimpleTestCase
  from django.utils import unittest
from ..servers.tests import LiveServerBase
  
  # Try to import PIL in either of the two ways it can end up installed.
  # Checking for the existence of Image is enough for CPython, but
  # for PyPy, you need to check for the underlying modules
keep add keep keep keep keep
 Fixed #15644 -- Improved Django File wrapper to support more file-like objects. Thanks nickname123 and Michael Palumbo for working on the patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@17871 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
tests/regressiontests/file_storage/tests.py