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
6a8b57df
Kaydet (Commit)
6a8b57df
authored
Eki 24, 2018
tarafından
Hasan Ramezani
Kaydeden (comit)
Tim Graham
Eki 24, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Completed test coverage of views.static.directory_name().
üst
10d82c85
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
0 deletions
+9
-0
.hidden
tests/view_tests/media/subdir/.hidden
+1
-0
visible
tests/view_tests/media/subdir/visible
+0
-0
test_static.py
tests/view_tests/tests/test_static.py
+8
-0
No files found.
tests/view_tests/media/subdir/.hidden
0 → 100644
Dosyayı görüntüle @
6a8b57df
The directory_name() view ignores files that start with a dot.
tests/view_tests/media/subdir/visible
0 → 100644
Dosyayı görüntüle @
6a8b57df
tests/view_tests/tests/test_static.py
Dosyayı görüntüle @
6a8b57df
...
@@ -111,6 +111,14 @@ class StaticTests(SimpleTestCase):
...
@@ -111,6 +111,14 @@ class StaticTests(SimpleTestCase):
def
test_index
(
self
):
def
test_index
(
self
):
response
=
self
.
client
.
get
(
'/
%
s/'
%
self
.
prefix
)
response
=
self
.
client
.
get
(
'/
%
s/'
%
self
.
prefix
)
self
.
assertContains
(
response
,
'Index of ./'
)
self
.
assertContains
(
response
,
'Index of ./'
)
# Directories have a trailing slash.
self
.
assertIn
(
'subdir/'
,
response
.
context
[
'file_list'
])
def
test_index_subdir
(
self
):
response
=
self
.
client
.
get
(
'/
%
s/subdir/'
%
self
.
prefix
)
self
.
assertContains
(
response
,
'Index of subdir/'
)
# File with a leading dot (e.g. .hidden) aren't displayed.
self
.
assertEqual
(
response
.
context
[
'file_list'
],
[
'visible'
])
@override_settings
(
TEMPLATES
=
[{
@override_settings
(
TEMPLATES
=
[{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
...
...
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