mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Refs #23919 -- Replaced usage of django.utils.http utilities with Python equivalents
Thanks Tim Graham for the review.
This commit is contained in:
parent
af598187ec
commit
fee42fd99e
16 changed files with 63 additions and 83 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue