Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
a98bcfb0
Kaydet (Commit)
a98bcfb0
authored
Şub 09, 2019
tarafından
Jon Dufresne
Kaydeden (comit)
Tim Graham
Şub 09, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #15362 -- Removed obsolete workaround in file_uploads test view.
üst
56b50cbf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
19 deletions
+2
-19
views.py
tests/file_uploads/views.py
+2
-19
No files found.
tests/file_uploads/views.py
Dosyayı görüntüle @
a98bcfb0
...
@@ -54,32 +54,15 @@ def file_upload_view_verify(request):
...
@@ -54,32 +54,15 @@ def file_upload_view_verify(request):
def
file_upload_unicode_name
(
request
):
def
file_upload_unicode_name
(
request
):
# Check to see if unicode name came through properly.
# Check to see if unicode name came through properly.
if
not
request
.
FILES
[
'file_unicode'
]
.
name
.
endswith
(
UNICODE_FILENAME
):
if
not
request
.
FILES
[
'file_unicode'
]
.
name
.
endswith
(
UNICODE_FILENAME
):
return
HttpResponseServerError
()
return
HttpResponseServerError
()
response
=
None
# Check to make sure the exotic characters are preserved even
# Check to make sure the exotic characters are preserved even
# through file save.
# through file save.
uni_named_file
=
request
.
FILES
[
'file_unicode'
]
uni_named_file
=
request
.
FILES
[
'file_unicode'
]
obj
=
FileModel
.
objects
.
create
(
testfile
=
uni_named_file
)
FileModel
.
objects
.
create
(
testfile
=
uni_named_file
)
full_name
=
'
%
s/
%
s'
%
(
UPLOAD_TO
,
uni_named_file
.
name
)
full_name
=
'
%
s/
%
s'
%
(
UPLOAD_TO
,
uni_named_file
.
name
)
if
not
os
.
path
.
exists
(
full_name
):
return
HttpResponse
()
if
os
.
path
.
exists
(
full_name
)
else
HttpResponseServerError
()
response
=
HttpResponseServerError
()
# Cleanup the object with its exotic file name immediately.
# (shutil.rmtree used elsewhere in the tests to clean up the
# upload directory has been seen to choke on unicode
# filenames on Windows.)
obj
.
delete
()
os
.
unlink
(
full_name
)
if
response
:
return
response
else
:
return
HttpResponse
()
def
file_upload_echo
(
request
):
def
file_upload_echo
(
request
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment