Commit 49f8e641 by Xavier Ordoquy

Fixed python2.7 compat issue.

parent 43c9a1c4
...@@ -17,7 +17,7 @@ except: ...@@ -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
......
...@@ -29,7 +29,7 @@ class FileSerializerTests(TestCase): ...@@ -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})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment