mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-17 03:51:03 +03:00
Fixed python2.7 compat issue.
This commit is contained in:
parent
43c9a1c466
commit
49f8e6419a
|
@ -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):
|
||||||
|
|
||||||
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})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user