From fee42fd99ee470528858c2ccb3621135c30ec262 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 26 Jan 2017 14:25:15 +0100 Subject: Refs #23919 -- Replaced usage of django.utils.http utilities with Python equivalents Thanks Tim Graham for the review. --- tests/file_uploads/tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/file_uploads') diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py index 44a7272753..51e6937598 100644 --- a/tests/file_uploads/tests.py +++ b/tests/file_uploads/tests.py @@ -7,13 +7,13 @@ import sys import tempfile as sys_tempfile import unittest from io import BytesIO, StringIO +from urllib.parse import quote from django.core.files import temp as tempfile from django.core.files.uploadedfile import SimpleUploadedFile from django.http.multipartparser import MultiPartParser, parse_header from django.test import SimpleTestCase, TestCase, client, override_settings from django.utils.encoding import force_bytes -from django.utils.http import urlquote from . import uploadhandler from .models import FileModel @@ -127,7 +127,7 @@ class FileUploadTests(TestCase): payload = client.FakePayload() payload.write('\r\n'.join([ '--' + client.BOUNDARY, - 'Content-Disposition: form-data; name="file_unicode"; filename*=UTF-8\'\'%s' % urlquote(UNICODE_FILENAME), + 'Content-Disposition: form-data; name="file_unicode"; filename*=UTF-8\'\'%s' % quote(UNICODE_FILENAME), 'Content-Type: application/octet-stream', '', 'You got pwnd.\r\n', @@ -153,7 +153,7 @@ class FileUploadTests(TestCase): payload.write( '\r\n'.join([ '--' + client.BOUNDARY, - 'Content-Disposition: form-data; name*=UTF-8\'\'file_unicode; filename*=UTF-8\'\'%s' % urlquote( + 'Content-Disposition: form-data; name*=UTF-8\'\'file_unicode; filename*=UTF-8\'\'%s' % quote( UNICODE_FILENAME ), 'Content-Type: application/octet-stream', -- cgit v1.3