Skip to content

Commit

Permalink
Avoided a deprecated alias on Python 3 in file_uploads test.
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Jan 8, 2015
1 parent 8713ea7 commit f487a32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/file_uploads/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from django.test import override_settings
from django.utils.encoding import force_bytes
from django.utils.http import urlquote
from django.utils.six import BytesIO, StringIO
from django.utils.six import BytesIO, PY2, StringIO

from . import uploadhandler
from .models import FileModel
Expand Down Expand Up @@ -108,7 +108,8 @@ def test_big_base64_upload(self):

def test_big_base64_newlines_upload(self):
self._test_base64_upload(
"Big data" * 68000, encode=base64.encodestring)
# encodestring is a deprecated alias on Python 3
"Big data" * 68000, encode=base64.encodestring if PY2 else base64.encodebytes)

def test_unicode_file_name(self):
tdir = sys_tempfile.mkdtemp()
Expand Down

0 comments on commit f487a32

Please sign in to comment.