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
48ce09f2
Kaydet (Commit)
48ce09f2
authored
Kas 05, 2013
tarafından
Bouke Haarsma
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed missing admindocs' site_header
üst
3ac823fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
views.py
django/contrib/admindocs/views.py
+3
-1
tests.py
tests/admin_docs/tests.py
+6
-0
No files found.
django/contrib/admindocs/views.py
Dosyayı görüntüle @
48ce09f2
...
@@ -5,6 +5,7 @@ import re
...
@@ -5,6 +5,7 @@ import re
from
django
import
template
from
django
import
template
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib
import
admin
from
django.contrib.admin.views.decorators
import
staff_member_required
from
django.contrib.admin.views.decorators
import
staff_member_required
from
django.db
import
models
from
django.db
import
models
from
django.core.exceptions
import
ImproperlyConfigured
,
ViewDoesNotExist
from
django.core.exceptions
import
ImproperlyConfigured
,
ViewDoesNotExist
...
@@ -36,11 +37,12 @@ class BaseAdminDocsView(TemplateView):
...
@@ -36,11 +37,12 @@ class BaseAdminDocsView(TemplateView):
if
not
utils
.
docutils_is_available
:
if
not
utils
.
docutils_is_available
:
# Display an error message for people without docutils
# Display an error message for people without docutils
self
.
template_name
=
'admin_doc/missing_docutils.html'
self
.
template_name
=
'admin_doc/missing_docutils.html'
return
self
.
render_to_response
(
{}
)
return
self
.
render_to_response
(
admin
.
site
.
each_context
()
)
return
super
(
BaseAdminDocsView
,
self
)
.
dispatch
(
*
args
,
**
kwargs
)
return
super
(
BaseAdminDocsView
,
self
)
.
dispatch
(
*
args
,
**
kwargs
)
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
kwargs
.
update
({
'root_path'
:
urlresolvers
.
reverse
(
'admin:index'
)})
kwargs
.
update
({
'root_path'
:
urlresolvers
.
reverse
(
'admin:index'
)})
kwargs
.
update
(
admin
.
site
.
each_context
())
return
super
(
BaseAdminDocsView
,
self
)
.
get_context_data
(
**
kwargs
)
return
super
(
BaseAdminDocsView
,
self
)
.
get_context_data
(
**
kwargs
)
...
...
tests/admin_docs/tests.py
Dosyayı görüntüle @
48ce09f2
...
@@ -25,6 +25,9 @@ class AdminDocViewTests(TestCase):
...
@@ -25,6 +25,9 @@ class AdminDocViewTests(TestCase):
self
.
client
.
login
(
username
=
'super'
,
password
=
'secret'
)
self
.
client
.
login
(
username
=
'super'
,
password
=
'secret'
)
response
=
self
.
client
.
get
(
reverse
(
'django-admindocs-docroot'
))
response
=
self
.
client
.
get
(
reverse
(
'django-admindocs-docroot'
))
self
.
assertContains
(
response
,
'<h1>Documentation</h1>'
,
html
=
True
)
self
.
assertContains
(
response
,
'<h1>Documentation</h1>'
,
html
=
True
)
self
.
assertContains
(
response
,
'<h1 id="site-name"><a href="/admin/">Django '
'administration</a></h1>'
)
def
test_bookmarklets
(
self
):
def
test_bookmarklets
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'django-admindocs-bookmarklets'
))
response
=
self
.
client
.
get
(
reverse
(
'django-admindocs-bookmarklets'
))
...
@@ -80,6 +83,9 @@ class AdminDocViewTests(TestCase):
...
@@ -80,6 +83,9 @@ class AdminDocViewTests(TestCase):
'<h3>The admin documentation system requires Python
\'
s '
'<h3>The admin documentation system requires Python
\'
s '
'<a href="http://docutils.sf.net/">docutils</a> library.</h3>'
,
'<a href="http://docutils.sf.net/">docutils</a> library.</h3>'
,
html
=
True
)
html
=
True
)
self
.
assertContains
(
response
,
'<h1 id="site-name"><a href="/admin/">Django '
'administration</a></h1>'
)
finally
:
finally
:
utils
.
docutils_is_available
=
True
utils
.
docutils_is_available
=
True
...
...
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