mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Replaced cStringIO.StringIO by io.BytesIO.
Also replaced StringIO.StringIO by BytesIO in some other appropriate places. StringIO is not available in Python 3.
This commit is contained in:
@@ -1372,19 +1372,6 @@ class OldFormForXTests(TestCase):
|
||||
self.assertEqual(instance.image.name, 'foo/test4.png')
|
||||
instance.delete()
|
||||
|
||||
# Test image field when cStringIO is not available
|
||||
from django.forms import fields
|
||||
from StringIO import StringIO
|
||||
old_StringIO = fields.StringIO
|
||||
fields.StringIO = StringIO
|
||||
try:
|
||||
f = ImageFileForm(
|
||||
data={'description': u'An image'},
|
||||
files={'image': SimpleUploadedFile('test.png', image_data)})
|
||||
self.assertEqual(f.is_valid(), True)
|
||||
finally:
|
||||
fields.StringIO = old_StringIO
|
||||
|
||||
def test_media_on_modelform(self):
|
||||
# Similar to a regular Form class you can define custom media to be used on
|
||||
# the ModelForm.
|
||||
|
||||
Reference in New Issue
Block a user