mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +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
|
||||
try:
|
||||
import cStringIO as StringIO
|
||||
import cStringIO.StringIO as StringIO
|
||||
except ImportError:
|
||||
from six import StringIO
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class FileSerializerTests(TestCase):
|
|||
|
||||
def test_create(self):
|
||||
now = datetime.datetime.now()
|
||||
file = StringIO.StringIO('stuff')
|
||||
file = StringIO('stuff')
|
||||
file.name = 'stuff.txt'
|
||||
file.size = file.len
|
||||
serializer = UploadedFileSerializer(data={'created': now}, files={'file': file})
|
||||
|
|
Loading…
Reference in New Issue
Block a user