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
e4ee3d8f
Kaydet (Commit)
e4ee3d8f
authored
Şub 24, 2013
tarafından
Florian Apolloner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed a few ResourceWarnings.
üst
e4e12875
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
13 deletions
+9
-13
tests.py
tests/modeltests/files/tests.py
+7
-10
tests.py
tests/regressiontests/file_storage/tests.py
+2
-2
runtests.py
tests/runtests.py
+0
-1
No files found.
tests/modeltests/files/tests.py
Dosyayı görüntüle @
e4ee3d8f
...
...
@@ -108,14 +108,12 @@ class FileStorageTests(TestCase):
temp_storage
.
save
(
'tests/example.txt'
,
ContentFile
(
'some content'
))
# Load it as python file object
file_obj
=
open
(
temp_storage
.
path
(
'tests/example.txt'
))
# Save it using storage and read its content
temp_storage
.
save
(
'tests/file_obj'
,
file_obj
)
with
open
(
temp_storage
.
path
(
'tests/example.txt'
))
as
file_obj
:
# Save it using storage and read its content
temp_storage
.
save
(
'tests/file_obj'
,
file_obj
)
self
.
assertTrue
(
temp_storage
.
exists
(
'tests/file_obj'
))
self
.
assertEqual
(
temp_storage
.
open
(
'tests/file_obj'
)
.
read
(),
b
'some content'
)
with
temp_storage
.
open
(
'tests/file_obj'
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
b
'some content'
)
def
test_stringio
(
self
):
...
...
@@ -127,9 +125,8 @@ class FileStorageTests(TestCase):
# Save it and read written file
temp_storage
.
save
(
'tests/stringio'
,
output
)
self
.
assertTrue
(
temp_storage
.
exists
(
'tests/stringio'
))
self
.
assertEqual
(
temp_storage
.
open
(
'tests/stringio'
)
.
read
(),
b
'content'
)
with
temp_storage
.
open
(
'tests/stringio'
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
b
'content'
)
...
...
tests/regressiontests/file_storage/tests.py
Dosyayı görüntüle @
e4ee3d8f
...
...
@@ -639,7 +639,7 @@ class FileLikeObjectTestCase(LiveServerBase):
f
=
File
(
file_like_object
)
stored_filename
=
self
.
storage
.
save
(
"remote_file.html"
,
f
)
stored_file
=
self
.
storage
.
open
(
stored_filename
)
remote_file
=
self
.
urlopen
(
'/example_view/'
)
self
.
assertEqual
(
stored_file
.
read
(),
remote_file
.
read
())
with
self
.
storage
.
open
(
stored_filename
)
as
stored_file
:
self
.
assertEqual
(
stored_file
.
read
(),
remote_file
.
read
())
tests/runtests.py
Dosyayı görüntüle @
e4ee3d8f
...
...
@@ -4,7 +4,6 @@ import shutil
import
subprocess
import
sys
import
tempfile
import
warnings
from
django
import
contrib
from
django.utils._os
import
upath
...
...
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