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
949ee521
Kaydet (Commit)
949ee521
authored
Nis 07, 2014
tarafından
Huu Nguyen
Kaydeden (comit)
Tim Graham
May 18, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #21230 -- removed direct settings manipulation from staticfile tests
üst
e3a9714c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
13 deletions
+3
-13
testfile.txt
.../staticfiles_tests/project/site_media/static/testfile.txt
+0
-2
tests.py
tests/staticfiles_tests/tests.py
+3
-11
No files found.
tests/staticfiles_tests/project/site_media/static/testfile.txt
deleted
100644 → 0
Dosyayı görüntüle @
e3a9714c
Test!
\ No newline at end of file
tests/staticfiles_tests/tests.py
Dosyayı görüntüle @
949ee521
...
...
@@ -6,7 +6,6 @@ import os
import
posixpath
import
shutil
import
sys
import
tempfile
import
unittest
from
django.template
import
loader
,
Context
...
...
@@ -121,17 +120,13 @@ class BaseCollectionTestCase(BaseStaticFilesTestCase):
"""
def
setUp
(
self
):
super
(
BaseCollectionTestCase
,
self
)
.
setUp
()
self
.
old_root
=
settings
.
STATIC_ROOT
settings
.
STATIC_ROOT
=
tempfile
.
mkdtemp
(
dir
=
os
.
environ
[
'DJANGO_TEST_TEMP_DIR'
]
)
if
not
os
.
path
.
exists
(
settings
.
STATIC_ROOT
):
os
.
mkdir
(
settings
.
STATIC_ROOT
)
self
.
run_collectstatic
()
# Use our own error handler that can handle .svn dirs on Windows
self
.
addCleanup
(
shutil
.
rmtree
,
settings
.
STATIC_ROOT
,
ignore_errors
=
True
,
onerror
=
rmtree_errorhandler
)
def
tearDown
(
self
):
settings
.
STATIC_ROOT
=
self
.
old_root
super
(
BaseCollectionTestCase
,
self
)
.
tearDown
()
def
run_collectstatic
(
self
,
**
kwargs
):
call_command
(
'collectstatic'
,
interactive
=
False
,
verbosity
=
'0'
,
ignore_patterns
=
[
'*.ignoreme'
],
**
kwargs
)
...
...
@@ -754,14 +749,11 @@ class TestServeStatic(StaticFilesTestCase):
self
.
assertEqual
(
self
.
_response
(
filepath
)
.
status_code
,
404
)
@override_settings
(
DEBUG
=
False
)
class
TestServeDisabled
(
TestServeStatic
):
"""
Test serving static files disabled when DEBUG is False.
"""
def
setUp
(
self
):
super
(
TestServeDisabled
,
self
)
.
setUp
()
settings
.
DEBUG
=
False
def
test_disabled_serving
(
self
):
self
.
assertFileNotFound
(
'test.txt'
)
...
...
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