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
80936251
Kaydet (Commit)
80936251
authored
Haz 23, 2014
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Created import-time test temp dirs in known location
Refs #17215. In the same spirit as
5de31cb8
.
üst
1d959602
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
4 deletions
+6
-4
models.py
tests/bug639/models.py
+2
-1
models.py
tests/file_storage/models.py
+2
-1
tests.py
tests/file_uploads/tests.py
+1
-1
models.py
tests/model_fields/models.py
+1
-1
No files found.
tests/bug639/models.py
Dosyayı görüntüle @
80936251
import
os
import
tempfile
import
tempfile
from
django.core.files.storage
import
FileSystemStorage
from
django.core.files.storage
import
FileSystemStorage
...
@@ -5,7 +6,7 @@ from django.db import models
...
@@ -5,7 +6,7 @@ from django.db import models
from
django.forms
import
ModelForm
from
django.forms
import
ModelForm
temp_storage_dir
=
tempfile
.
mkdtemp
()
temp_storage_dir
=
tempfile
.
mkdtemp
(
dir
=
os
.
environ
[
'DJANGO_TEST_TEMP_DIR'
]
)
temp_storage
=
FileSystemStorage
(
temp_storage_dir
)
temp_storage
=
FileSystemStorage
(
temp_storage_dir
)
...
...
tests/file_storage/models.py
Dosyayı görüntüle @
80936251
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
and where files should be stored.
and where files should be stored.
"""
"""
import
os
import
random
import
random
import
tempfile
import
tempfile
...
@@ -12,7 +13,7 @@ from django.db import models
...
@@ -12,7 +13,7 @@ from django.db import models
from
django.core.files.storage
import
FileSystemStorage
from
django.core.files.storage
import
FileSystemStorage
temp_storage_location
=
tempfile
.
mkdtemp
()
temp_storage_location
=
tempfile
.
mkdtemp
(
dir
=
os
.
environ
[
'DJANGO_TEST_TEMP_DIR'
]
)
temp_storage
=
FileSystemStorage
(
location
=
temp_storage_location
)
temp_storage
=
FileSystemStorage
(
location
=
temp_storage_location
)
...
...
tests/file_uploads/tests.py
Dosyayı görüntüle @
80936251
...
@@ -23,7 +23,7 @@ from .models import FileModel
...
@@ -23,7 +23,7 @@ from .models import FileModel
UNICODE_FILENAME
=
'test-0123456789_中文_Orléans.jpg'
UNICODE_FILENAME
=
'test-0123456789_中文_Orléans.jpg'
MEDIA_ROOT
=
sys_tempfile
.
mkdtemp
()
MEDIA_ROOT
=
sys_tempfile
.
mkdtemp
(
dir
=
os
.
environ
[
'DJANGO_TEST_TEMP_DIR'
]
)
UPLOAD_TO
=
os
.
path
.
join
(
MEDIA_ROOT
,
'test_upload'
)
UPLOAD_TO
=
os
.
path
.
join
(
MEDIA_ROOT
,
'test_upload'
)
...
...
tests/model_fields/models.py
Dosyayı görüntüle @
80936251
...
@@ -194,7 +194,7 @@ if Image:
...
@@ -194,7 +194,7 @@ if Image:
attr_class
=
TestImageFieldFile
attr_class
=
TestImageFieldFile
# Set up a temp directory for file storage.
# Set up a temp directory for file storage.
temp_storage_dir
=
tempfile
.
mkdtemp
()
temp_storage_dir
=
tempfile
.
mkdtemp
(
dir
=
os
.
environ
[
'DJANGO_TEST_TEMP_DIR'
]
)
temp_storage
=
FileSystemStorage
(
temp_storage_dir
)
temp_storage
=
FileSystemStorage
(
temp_storage_dir
)
temp_upload_to_dir
=
os
.
path
.
join
(
temp_storage
.
location
,
'tests'
)
temp_upload_to_dir
=
os
.
path
.
join
(
temp_storage
.
location
,
'tests'
)
...
...
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