Fixed python2.7 compat issue.

This commit is contained in:
Xavier Ordoquy 2012-11-22 00:43:56 +01:00
parent 43c9a1c466
commit 49f8e6419a
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ except:
# cStringIO only if it's available, otherwise StringIO # cStringIO only if it's available, otherwise StringIO
try: try:
import cStringIO as StringIO import cStringIO.StringIO as StringIO
except ImportError: except ImportError:
from six import StringIO from six import StringIO

View File

@ -29,7 +29,7 @@ class FileSerializerTests(TestCase):
def test_create(self): def test_create(self):
now = datetime.datetime.now() now = datetime.datetime.now()
file = StringIO.StringIO('stuff') file = StringIO('stuff')
file.name = 'stuff.txt' file.name = 'stuff.txt'
file.size = file.len file.size = file.len
serializer = UploadedFileSerializer(data={'created': now}, files={'file': file}) serializer = UploadedFileSerializer(data={'created': now}, files={'file': file})