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
3aae43d8
Kaydet (Commit)
3aae43d8
authored
Nis 24, 2018
tarafından
Claude Paroz
Kaydeden (comit)
Tim Graham
Nis 24, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28973 -- Silenced copying/linking messages in collectstatic's default verbosity.
üst
d1413c5d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
3 deletions
+31
-3
collectstatic.py
.../contrib/staticfiles/management/commands/collectstatic.py
+2
-2
cases.py
tests/staticfiles_tests/cases.py
+4
-1
test_management.py
tests/staticfiles_tests/test_management.py
+25
-0
No files found.
django/contrib/staticfiles/management/commands/collectstatic.py
Dosyayı görüntüle @
3aae43d8
...
...
@@ -309,7 +309,7 @@ class Command(BaseCommand):
if
self
.
dry_run
:
self
.
log
(
"Pretending to link '
%
s'"
%
source_path
,
level
=
1
)
else
:
self
.
log
(
"Linking '
%
s'"
%
source_path
,
level
=
1
)
self
.
log
(
"Linking '
%
s'"
%
source_path
,
level
=
2
)
full_path
=
self
.
storage
.
path
(
prefixed_path
)
try
:
os
.
makedirs
(
os
.
path
.
dirname
(
full_path
))
...
...
@@ -348,7 +348,7 @@ class Command(BaseCommand):
if
self
.
dry_run
:
self
.
log
(
"Pretending to copy '
%
s'"
%
source_path
,
level
=
1
)
else
:
self
.
log
(
"Copying '
%
s'"
%
source_path
,
level
=
1
)
self
.
log
(
"Copying '
%
s'"
%
source_path
,
level
=
2
)
with
source_storage
.
open
(
path
)
as
source_file
:
self
.
storage
.
save
(
prefixed_path
,
source_file
)
self
.
copied_files
.
append
(
prefixed_path
)
tests/staticfiles_tests/cases.py
Dosyayı görüntüle @
3aae43d8
...
...
@@ -61,6 +61,8 @@ class CollectionTestCase(BaseStaticFilesMixin, SimpleTestCase):
is separated because some test cases need those asserts without
all these tests.
"""
run_collectstatic_in_setUp
=
True
def
setUp
(
self
):
super
()
.
setUp
()
temp_dir
=
tempfile
.
mkdtemp
()
...
...
@@ -68,7 +70,8 @@ class CollectionTestCase(BaseStaticFilesMixin, SimpleTestCase):
# rather than as a context manager
self
.
patched_settings
=
self
.
settings
(
STATIC_ROOT
=
temp_dir
)
self
.
patched_settings
.
enable
()
self
.
run_collectstatic
()
if
self
.
run_collectstatic_in_setUp
:
self
.
run_collectstatic
()
# Same comment as in runtests.teardown.
self
.
addCleanup
(
shutil
.
rmtree
,
temp_dir
)
...
...
tests/staticfiles_tests/test_management.py
Dosyayı görüntüle @
3aae43d8
...
...
@@ -164,6 +164,31 @@ class TestCollection(TestDefaults, CollectionTestCase):
self
.
assertFileNotFound
(
'test/CVS'
)
class
TestCollectionVerbosity
(
CollectionTestCase
):
copying_msg
=
'Copying '
run_collectstatic_in_setUp
=
False
staticfiles_copied_msg
=
'static files copied to'
def
test_verbosity_0
(
self
):
stdout
=
StringIO
()
self
.
run_collectstatic
(
verbosity
=
0
,
stdout
=
stdout
)
self
.
assertEqual
(
stdout
.
getvalue
(),
''
)
def
test_verbosity_1
(
self
):
stdout
=
StringIO
()
self
.
run_collectstatic
(
verbosity
=
1
,
stdout
=
stdout
)
output
=
stdout
.
getvalue
()
self
.
assertIn
(
self
.
staticfiles_copied_msg
,
output
)
self
.
assertNotIn
(
self
.
copying_msg
,
output
)
def
test_verbosity_2
(
self
):
stdout
=
StringIO
()
self
.
run_collectstatic
(
verbosity
=
2
,
stdout
=
stdout
)
output
=
stdout
.
getvalue
()
self
.
assertIn
(
self
.
staticfiles_copied_msg
,
output
)
self
.
assertIn
(
self
.
copying_msg
,
output
)
class
TestCollectionClear
(
CollectionTestCase
):
"""
Test the ``--clear`` option of the ``collectstatic`` management command.
...
...
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